Comparing version 0.2.12 to 0.2.13
@@ -45,2 +45,3 @@ #!/usr/bin/env node | ||
lex; | ||
raw = raw.replace(/\r\n/g, '\n'); | ||
if (args.lexfile) { | ||
@@ -70,3 +71,8 @@ lex = IO.read(IO.join(IO.cwd(),args.lexfile)); | ||
function processGrammar (rawGrammar, lex, name) { | ||
var grammar = require("./bnf").parse(rawGrammar); | ||
var grammar; | ||
try { | ||
grammar = require("./bnf").parse(rawGrammar); | ||
} catch (e) { | ||
grammar = JSON.parse(rawGrammar); | ||
} | ||
var opt = grammar.options || {}; | ||
@@ -73,0 +79,0 @@ if (lex) grammar.lex = require("./jisonlex").parse(lex); |
@@ -67,8 +67,8 @@ #!/usr/bin/env node | ||
if (typeof handle[i][1] === 'string') { | ||
if (handle[i][2] && handle[i][2].prec) { | ||
s += " %prec "+handle[i][2].prec; | ||
} | ||
if (!options.stripActions) { | ||
s += "\n {"+handle[i][1]+"}"; | ||
} | ||
if (handle[i][2] && handle[i][2].prec) { | ||
s += " %prec "+handle[i][2].prec; | ||
} | ||
} else if (handle[i][1].prec) { | ||
@@ -75,0 +75,0 @@ s += " %prec "+handle[i][1].prec; |
@@ -5,3 +5,3 @@ { | ||
"description": "A parser generator with Bison's API", | ||
"version": "0.2.12", | ||
"version": "0.2.13", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "jison", |
@@ -65,2 +65,3 @@ Jison | ||
// `grammar` can also be a string that uses jison's grammar format | ||
var parser = new Parser(grammar); | ||
@@ -67,0 +68,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
239166
5992
145
12