I've just started playing with PEG.js and have a problem with a grammar (vastly simplified for debugging):
start
= presingle single
/ preplural plural
presingle
= "a"
/ "b"
preplural
= "b"
/ "c"
single
= "d"
/ "e"
plural
= "dd"
/ "ee"
I'm using https://pegjs.org/online
This grammar fails to parse bdd
.
Line 1, column 3: Expected "a" but "d" found.
Is this something which PEGs cannot do, or can I transform my grammar into something which will parse this?
P.S. If I try to parse the (erroneously advised?) bda
I get the nonsensical error:
Line 1, column 3: Expected "a" but "a" found.