Better error position explanation

Based on @Mingun's help.
master
Adrian Sampson 8 years ago
parent 3330ceb7b8
commit ceebc8cda1

@ -458,9 +458,12 @@ character class that failed to match:
> Expected [0-9] but "a" found. > Expected [0-9] but "a" found.
Aside from the text content of messages, human-readable names also have a Aside from the text content of messages, human-readable names also have a
subtler effect on *where* errors are reported. PEG.js prefers shorter matches subtler effect on *where* errors are reported. PEG.js prefers to match
for named rules and longer matches for unnamed rules. For example, for this named rules completely or not at all, but not partially. Unnamed rules,
rule matching a comma-separated list of integers: on the other hand, can produce an error in the middle of their
subexpressions.
For example, for this rule matching a comma-separated list of integers:
seq seq
= integer ("," integer)* = integer ("," integer)*

Loading…
Cancel
Save