Skip to content

Define parsers outside of TAG for use within it #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
myedibleenso opened this issue Apr 3, 2019 · 0 comments
Open

Define parsers outside of TAG for use within it #41

myedibleenso opened this issue Apr 3, 2019 · 0 comments

Comments

@myedibleenso
Copy link
Collaborator

It would be convenient to define parsers outside of TAG for use within it. This would allow users to easily adjust the behavior of a parser for an evolving format (ex. https://github.com/lum-ai/odinson).

Plan

  • To support this we'd need to discuss how a custom parser should be registered with TAG. Perhaps it should be passed in the config object (ex. {"odin": mycustomParseFunction}, where mycustomParseFunction returns data.)

  • The Parser constructor and helper functions in parse/parse.js will also need to be modified to work over a dynamic set of parsers instead of (or in addition to) the statically-defined ones TAG currently supports.

The parser system as currently written is based on classes, and Parser reads directly from each parser object's .data (e.g., from this.odin.data in the parseOdin() function) property. We may want to consider switching to a purely functional approach to support custom parsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant