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
I am experiencing some oddities with using or expressions. I have replicated it with a trivial example:
import parsley
x = parsley.makeGrammar(
"""
away_we_go = ('away we go' | 'off and running') -> "away_we_go"
back_underway = ('back underway' | 'back under way') -> "back_underway"
all = (anything*) -> "all"
foo = away_we_go | back_underway | all
""",
{}
)
print x("giorenagoirhger").foo() # all
print x("giorena goirhger").foo() # all
print x("away we go").foo() # away_we_go
print x("back underway").foo() # back_underway
print x("go").foo() # all
print x("lets go").foo() # all
print x("we are back under way go").foo() # all
print x("we are back under way").foo() # all
print x("back under way go").foo() # ERROR
Traceback (most recent call last):
File "process/tests/parsley_test.py", line 21, in <module>
print x("back under way go").foo() # ERROR
File "/Users/reuben/.virtualenvs/processor/lib/python2.7/site-packages/parsley.py", line 98, in invokeRule
raise err
ometa.runtime.ParseError:
back under way go
^
Parse error at line 1, column 1: expected EOF. trail: []
unless I am mistaken "back under way go" should fail to match the away_we_go pattern and the back_underway pattern and then match the all pattern.
The text was updated successfully, but these errors were encountered:
I am experiencing some oddities with using
or
expressions. I have replicated it with a trivial example:unless I am mistaken "back under way go" should fail to match the
away_we_go
pattern and theback_underway
pattern and then match theall
pattern.The text was updated successfully, but these errors were encountered: