@ -1068,8 +1068,7 @@ function generateJS(ast, options) {
' function expected(description, location) {' ,
' function expected(description, location) {' ,
' location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)' ,
' location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)' ,
'' ,
'' ,
' throw peg$buildException(' ,
' throw peg$buildStructuredError(' ,
' null,' ,
' [peg$otherExpectation(description)],' ,
' [peg$otherExpectation(description)],' ,
' input.substring(peg$savedPos, peg$currPos),' ,
' input.substring(peg$savedPos, peg$currPos),' ,
' location' ,
' location' ,
@ -1079,7 +1078,7 @@ function generateJS(ast, options) {
' function error(message, location) {' ,
' function error(message, location) {' ,
' location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)' ,
' location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)' ,
'' ,
'' ,
' throw peg$build Exception(message, null, null , location);',
' throw peg$build SimpleError(message , location);',
' }' ,
' }' ,
'' ,
'' ,
' function peg$literalExpectation(text, ignoreCase) {' ,
' function peg$literalExpectation(text, ignoreCase) {' ,
@ -1164,9 +1163,13 @@ function generateJS(ast, options) {
' peg$maxFailExpected.push(expected);' ,
' peg$maxFailExpected.push(expected);' ,
' }' ,
' }' ,
'' ,
'' ,
' function peg$buildException(message, expected, found, location) {' ,
' function peg$buildSimpleError(message, location) {' ,
' return new peg$SyntaxError(message, null, null, location);' ,
' }' ,
'' ,
' function peg$buildStructuredError(expected, found, location) {' ,
' return new peg$SyntaxError(' ,
' return new peg$SyntaxError(' ,
' message !== null ? message : peg$SyntaxError.buildMessage(expected, found),' ,
' peg$SyntaxError.buildMessage(expected, found),',
' expected,' ,
' expected,' ,
' found,' ,
' found,' ,
' location' ,
' location' ,
@ -1205,8 +1208,7 @@ function generateJS(ast, options) {
' peg$fail(peg$endExpectation());' ,
' peg$fail(peg$endExpectation());' ,
' }' ,
' }' ,
'' ,
'' ,
' throw peg$buildException(' ,
' throw peg$buildStructuredError(' ,
' null,' ,
' peg$maxFailExpected,' ,
' peg$maxFailExpected,' ,
' peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,' ,
' peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,' ,
' peg$maxFailPos < input.length' ,
' peg$maxFailPos < input.length' ,