Closed marcelocantos closed 4 years ago
I think this is a 👎 from me. I'm trying to disconnect the parser compiler from the parser engine, nothing is stopping (package) users from implemeting this as a wrapper around the .Parse()
call though
Wbnf was designed to support dynamic parsing. I'm worried that any changes to the architecture that make the above difficult or impossible within the engine itself are essentially negating this core design goal.
Just pushed a working implementation (which also stop NewFromParserNode crashing if it gets a Scanner instead of a Node).
question:
grammar.Parse()
directly? - this would force the wbnf/wbnf package dependancy onto the users.func ParseTerm(term string, input *parser.Scanner) (MyGrammarNode, error) {}
(proabbly in addition to the existing func Parse()
Done.
@ChloePlanet done??
Currently,
Parse
takes arule Rule
parameter. This can be generalised to any term expression. For instance, today you can parse a JSON object.But what if you want to parse a sequence of them?
or even a
//
-delimited list of them?