Set the "found" property of syntax errors produced by "error" to null

The property doesn't correspond to anything in the error's message.
redux
David Majda 8 years ago
parent 6ca546a44e
commit e03d92488a

@ -1079,12 +1079,7 @@ function generateJS(ast, options) {
' function error(message, location) {',
' location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)',
'',
' throw peg$buildException(',
' message,',
' null,',
' input.substring(peg$savedPos, peg$currPos),',
' location',
' );',
' throw peg$buildException(message, null, null, location);',
' }',
'',
' function peg$literalExpectation(text, ignoreCase) {',

@ -534,12 +534,7 @@ function peg$parse(input, options) {
function error(message, location) {
location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
throw peg$buildException(
message,
null,
input.substring(peg$savedPos, peg$currPos),
location
);
throw peg$buildException(message, null, null, location);
}
function peg$literalExpectation(text, ignoreCase) {

@ -1218,7 +1218,7 @@ describe("generated parser behavior", function() {
expect(parser).toFailToParse("a", {
message: "a",
found: "a",
found: null,
expected: null,
location: {
start: { offset: 0, line: 1, column: 1 },
@ -1240,7 +1240,7 @@ describe("generated parser behavior", function() {
expect(parser).toFailToParse("a", {
message: "a",
expected: null,
found: "a",
found: null,
location: {
start: { offset: 1, line: 1, column: 2 },
end: { offset: 2, line: 1, column: 3 }

Loading…
Cancel
Save