ohm icon indicating copy to clipboard operation
ohm copied to clipboard

Semantic actions for comments defined under the space rule

Open DaBisounours opened this issue 1 year ago • 1 comments

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

DaBisounours avatar Apr 22 '23 13:04 DaBisounours

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.

toddobryan avatar Sep 25 '23 16:09 toddobryan