A choice pattern seems to throw off the parser if followed later by a zero-or-more quantified pattern
#18
Closed
opened 6 years ago by bkovitz
·
8 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
In the grammar below, once a
THING
containing the case marked by the comment has matched, the grammar returns an error on the nextTHING
.I can't figure out how to attach a file in GitHub, but you can reproduce the error by pasting the text above into a file called
bug.brag
and the text below into a file calledbug.rkt
and running the latter.Here's a workaround:
Does this grammar fix the problem for you?
(If so it doesn’t negate the possibility of a bug, but I am interested in collecting information about its behavior)
Nope, same error.
That’s strange, because it does fix the parse error for me. In any case, I can reproduce the original error (and have simplified it further). Also, I have reproduced it in the original
ragg
package thatbrag
is based on, so it may take a little excavation to sort out.Making a note of the minimal error case:
I just tried your alternate grammar with
arg : IDENTIFIER [":" IDENTIFIER]
again and it does work. Sorry, I must have done something wrong when I tried it the first time.I changed the way the
*
quantifier works, which I believe fixes the problem.