How do you get instaparse to skip whitespace between tokens?
(I could of course define whitespace as a token in its own right and insert it between all the elements on the right hand side of every rule, but I'm dealing with a grammar that has over three hundred rules, and hoping for a way to say it once rather than three hundred times.)
You can pass an optional parameter to turn on auto-whitespace:
(doc insta/parser)
-------------------------
instaparse.core/parser
([grammar-specification & {:as options}])
:auto-whitespace (:standard or :comma)
or
:auto-whitespace custom-whitespace-parser
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With