erikrose / parsimonious

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

How to stop consuming after find reserved word #224

Open nhan-dang opened 2 years ago

nhan-dang commented 2 years 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