erikrose / parsimonious

The fastest pure-Python PEG parser I can muster
MIT License
1.79k stars 126 forks source link

How to stop consuming after find reserved word #224

Open nhan-dang opened 1 year ago

nhan-dang commented 1 year ago

I have a question: I have defined a grammar looks like this in general: value to value: value = ~r"[\w]+(_? [\w]+)" to = "to" So if i parse: "place the shelves to higher place", i will give the IncompleteParseError, because the value also consume the entire string. I want to have it split into 2 values: "place the shelves" and "higher place". Is there any way i can define this? Thank you