Open markw65 opened 8 months ago
This grammar does not expect "start" rule at this position, it expect literally nothing
But that was true whether or not it's a named
rule.
Probably, it would be better to emit compiler error here instead
I guess thats ok if it's a start rule that always fails - but my examples only used start rules to exemplify the problem. You could use it as a catch all where a promising start goes off the rails:
echo 'start = [ab] fail / [cde]; fail "bzzt try again" = []' | node bin/peggy.js -t "ax"
Ok, its still not a great example, but it could be useful to have a named
, NEVER_MATCH
expression.
Found while working on #452.
The condition was backwards, so the error got misreported:
Before the fix:
After the fix:
There was already a test, but it was testing for the incorrect result...