Closed tyilo closed 1 year ago
Sorry about this. Hadn't done a deploy in a while so that feature wasn't available on the version deployed on pypi. I deployed the new version. Please do pip install parsimonious==0.10.0
and your problem should be fixed. I just tested it in a virtualenv:
>>> from parsimonious.grammar import Grammar
>>>
>>> grammar = Grammar(
... """
... exactly_three_as = A{3}
... A = "A"
... """
... )
>>>
>>> print(grammar.parse("AAA"))
<Node called "exactly_three_as" matching "AAA">
<Node called "A" matching "A">
<Node called "A" matching "A">
<Node called "A" matching "A">
This code works:
But after rewriting it to use repetition it doesn't:
It raises the following exception:
I'm using version 0.9.0.