ohm
ohm copied to clipboard
Semantic actions for comments defined under the space rule
Hi, amazing work with this lib!
I followed this pattern to support comments in my grammar :
space += comment
Though I'm also interested in defining a Semantic Action for the comment rule. But as the space is automatically skipped the action is never called.
Is there a way I can force the action to be called without explicitly defining where the language allows comments in my grammar ( a LOT of places...) ?
Thanks
This is completely off-topic, but I've been working on a parsing framework and thought about dealing with whitespace/comments in the Reader before it gets to the parser and making it so that you could recover those from the Reader later.