Skip to content
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

feature(grammar): allow key-value options #6

Closed
wants to merge 1 commit into from

Conversation

just-boris
Copy link

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
Copy link
Author

ping @zaach

@zaach
Copy link
Owner

zaach commented Jan 23, 2015

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.

@just-boris
Copy link
Author

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

GerHobbelt added a commit to GerHobbelt/ebnf-parser that referenced this pull request Oct 26, 2015
…icate work on zaach#6. Merged to flag this as inspected and processed, however sticking with my own implementation of this as it's stricter (e.g. only '=' token production inside `conditions` lex phase (a.k.a. condition state) and tested support for quoted and quote-carrying values. Hence 'use ours' on this merge. Sorry.

# Conflicts:
#	bnf.l
#	bnf.y
#	ebnf-parser.js
#	tests/bnf_parse.js
GerHobbelt added a commit to GerHobbelt/ebnf-parser that referenced this pull request Oct 26, 2015
…cate work on zaach#6. Merged to flag this as inspected and processed, however sticking with my own implementation of this as it's stricter (e.g. only '=' token production inside `conditions` lex phase (a.k.a. condition state) and tested support for quoted and quote-carrying values. Hence 'use ours' on this merge. Sorry.

Note: one test tile change included.

# Conflicts:
#	bnf.l
#	bnf.y
#	ebnf-parser.js
#	tests/bnf_parse.js

# Conflicts:
#	bnf.y
#	tests/bnf_parse.js
@just-boris just-boris closed this Jan 7, 2025
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

Successfully merging this pull request may close these issues.

2 participants