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

Fix moduleName (and other options?) being lost #290

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

millerdev
Copy link

This bug is mentioned in cf9346c#commitcomment-10419124

millerdev referenced this pull request Jul 8, 2015
I keep finding myself reimplementing the cli script and it would be much
easier if I could simply require it and use it in scripts. The basic
change is that main accepts an options argument. The rest of the
changes: add documentation to the source code, expose a method for
processing grammar files in any combination the cli accepts, and expose
a method for generating a parser as a string. It's all pretty much the
same code as was there, just shifted around so I could expose things to
users and wrapped up so things don't go haywire.
@@ -139,7 +139,7 @@ cli.generateParserString = function generateParserString(opts, grammar) {
opts = opts || {};
var jison = require('./jison.js');

var settings = grammar.options || {};
var settings = grammar.options || opts;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this really check either or, or would it desirable to merge grammar.options and opts with e.g. extend?

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