You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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.
11 years ago
..
compiler Fix error messages in certain cases with trailing input 11 years ago
compiler.js Plugin API: Split compiler passes into stages 12 years ago
grammar-error.js Git repo npmization: Make the repo a npm package 12 years ago
parser.js Fix error messages in certain cases with trailing input 11 years ago
peg.js Plugin API: Split compiler passes into stages 12 years ago
utils.js Fix typo in comment 11 years ago