pegjs-util
Advanced tools
Comparing version 1.2.0 to 1.3.0
{ | ||
"name": "pegjs-util", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Utility Class for PEG.js", | ||
@@ -13,3 +13,3 @@ "main": "PEGUtil.js", | ||
"dependencies": { | ||
"pegjs": ">=0.8.0" | ||
"pegjs": ">=0.9.0" | ||
}, | ||
@@ -16,0 +16,0 @@ "ignore": [ |
{ | ||
"name": "pegjs-util", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Utility Class for PEG.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ "pegjs", "parser", "AST", "unroll" ], |
@@ -59,11 +59,8 @@ /* | ||
/* helper function for generating a function to unroll the parse stack */ | ||
PEGUtil.makeUnroll = function (location, SyntaxError) { | ||
PEGUtil.makeUnroll = function (location, options) { | ||
return function (first, list, take) { | ||
if ( typeof list !== "object" | ||
|| !(list instanceof Array)) | ||
throw new SyntaxError("unroll: invalid list argument for unrolling", | ||
(typeof list), "Array", | ||
location().start.offset, | ||
location().start.line, | ||
location().start.column); | ||
throw new options.util.__SyntaxError("unroll: invalid list argument for unrolling", | ||
(typeof list), "Array", location()); | ||
if (typeof take !== "undefined") { | ||
@@ -146,5 +143,6 @@ if (typeof take === "number") | ||
util: { | ||
makeUnroll: PEGUtil.makeUnroll, | ||
makeAST: PEGUtil.makeAST, | ||
__makeAST: makeAST | ||
makeUnroll: PEGUtil.makeUnroll, | ||
makeAST: PEGUtil.makeAST, | ||
__makeAST: makeAST, | ||
__SyntaxError: parser.SyntaxError | ||
} | ||
@@ -151,0 +149,0 @@ }; |
@@ -41,4 +41,4 @@ | ||
{ | ||
var unroll = options.util.makeUnroll(location, SyntaxError) | ||
var ast = options.util.makeAST(location, options) | ||
var unroll = options.util.makeUnroll(location, options) | ||
var ast = options.util.makeAST (location, options) | ||
} | ||
@@ -160,3 +160,3 @@ | ||
{ | ||
var unroll = options.util.makeUnroll(location, SyntaxError) | ||
var unroll = options.util.makeUnroll(location, options) | ||
} | ||
@@ -163,0 +163,0 @@ ``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27712
471