lark-parser / lark

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.
MIT License
4.88k stars 414 forks source link

ignore.WS but still use it in some rules #1239

Closed vsraptor closed 1 year ago

vsraptor commented 1 year ago

Is there a way to in general ignore white space but use it for parsing in some rules ... f.e. i want to distinguish between sentence/s and a block of sentences


sentence : words+ "."
sentences : sentence+
block : NL NL sentences NL NL 

%ignore.WS
erezsh commented 1 year ago

Did you try giving NL a higher priority?

vsraptor commented 1 year ago

it worked, thanks