Skip to content

Commit

Permalink
compiled-grammar.js is strict mode compatible (#26)
Browse files Browse the repository at this point in the history
compiled-grammar.js has some extraneous parts removed to work around jison bug preventing strict mode evaluation.
  • Loading branch information
download13 authored and rcs committed Apr 18, 2017
1 parent 0ce6f49 commit 12f4077
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/route/compiled-grammar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion scripts/compile_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ var parser = new jison.Parser(grammar);
// eslint-disable-next-line no-underscore-dangle
parser.lexer = new Lexer(grammar.lex, null, grammar.terminals_);

var compiledGrammar = parser.generate({ moduleType: 'js' });
// Remove _token_stack label manually until fixed in jison:
// https://github.com/zaach/jison/issues/351
// https://github.com/zaach/jison/pull/352
var compiledGrammar = parser.generate({ moduleType: 'js' }).replace(/_token_stack:\s?/, '');


fs.writeFileSync(
Expand Down

0 comments on commit 12f4077

Please sign in to comment.