Using the grammar
start
= b
/ a
a
= "4" "2"
b
= "4"
with peg.js
recognizes 4 but not 42 in which case the error
"Line 1, column 2: Expected end of input but "2" found."
is reported. Obviously the parser completes the start -> b
rule consuming "4" and then has no idea what to do with the "2". But why doesn't it try again with the other rule for a
, when it encounters the error?