Convenience DSL for ignored whitespace between patterns
watzon opened this issue · comments
Chris Watson commented
It would be ideal if parsers didn't have to manually define a whitespace pattern and use it throughout. Instead we could have a special infix operator that tells pegmatite whether or not to ignore the whitepsace between two rules.
For example:
my_rule = str("hello") ^ str("world")
would match both "hello world" and "helloworld". Ideally we should also be able to define an ignore pattern, since all whitespace is not created equally. Maybe having a special whitespace_chars
method or something.