pegjs/lib/compiler/passes
David Majda a56d3ac94f Fix error messages in certain cases with trailing input
In case the generated parser parsed successfully part of input and left
some input unparsed (trailing input), the error message produced was
sometimes wrong. The code worked correctly only if there were no match
failures in the successfully parsed part (highly unlikely).

This commit fixes things by explicitly triggering a match failure with the
following expectation at the end of the successfully parsed part of the
input:

  peg$fail({ type: "end", description: "end of input" });

This change also made it possible to simplify the |buildMessage|
function, which can now ignore the case of no expectations.

Fixes #119.
2013-12-08 14:50:22 +01:00
..
generate-bytecode.js Renumber bytecode instructions to make them sequential 2013-12-07 15:58:26 +01:00
generate-javascript.js Fix error messages in certain cases with trailing input 2013-12-08 14:50:22 +01:00
remove-proxy-rules.js Move options handling from passes to |PEG.compiler.compile| 2013-01-06 10:32:52 +01:00
report-left-recursion.js Make |GrammarError| require work also in the browser version 2013-01-05 21:16:36 +01:00
report-missing-rules.js Make |GrammarError| require work also in the browser version 2013-01-05 21:16:36 +01:00