ebnf-parser icon indicating copy to clipboard operation
ebnf-parser copied to clipboard

feature(grammar): allow key-value options

Open just-boris opened this issue 11 years ago • 3 comments

Now you have ability to specify options in grammar file. It's enough for me, because I have to declare my module name in my file. I can do it in JSON file and I want to do it in BNF files as well.

I've tested these changes allow to do it. I will can write like this

%options moduleName=myGrammar;

Jison will get this option and declare generated parser with proper module name

just-boris avatar Dec 18 '14 12:12 just-boris

ping @zaach

just-boris avatar Jan 23 '15 10:01 just-boris

For the syntax, I'd prefer something that resembles what the lexical grammar already uses, e.g. %options myopt1 myopt2. We could expand that to allow assignment of a value, e.g. %options myopt1=blah myopt2=foob.

zaach avatar Jan 23 '15 22:01 zaach

@zaach done. Now it consumes = symbol between key and value

just-boris avatar Jun 07 '15 21:06 just-boris