You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on experience with other PEG pargens, I'd think this should work:
>>> from parsimonious import Grammar
>>> Grammar("a = b c / d")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/eevee/.local/lib/python3.4/site-packages/parsimonious/grammar.py", line 63, in __init__
exprs, first = self._expressions_from_rules(rules)
File "/home/eevee/.local/lib/python3.4/site-packages/parsimonious/grammar.py", line 78, in _expressions_from_rules
tree = rule_grammar.parse(rules)
File "/home/eevee/.local/lib/python3.4/site-packages/parsimonious/grammar.py", line 83, in parse
return self.default_rule.parse(text, pos=pos)
File "/home/eevee/.local/lib/python3.4/site-packages/parsimonious/expressions.py", line 42, in parse
raise IncompleteParseError(text, node.end, self)
parsimonious.exceptions.IncompleteParseError: Rule 'rules' matched in its entirety, but it didn't consume all the text. The non-matching portion of the text begins with '/ d' (line 1, column 9).
But / is defined with:
or_term="/"_termored=termor_term+
Wrapping everything in parentheses works, but is a little inconvenient when e.g. parsing a language with operators and trying to consume the whitespace after all of them :)
The text was updated successfully, but these errors were encountered:
Based on experience with other PEG pargens, I'd think this should work:
But
/
is defined with:Wrapping everything in parentheses works, but is a little inconvenient when e.g. parsing a language with operators and trying to consume the whitespace after all of them :)
The text was updated successfully, but these errors were encountered: