-
In Flex lexers a common pattern is to transform the matched text slightly, e.g. to strip characters like quotes or a prefix. Something like:
This will return the string without the $ prefix. From reading the documentation it was not clear to me how to do this with Chevrotain. Is there a way to transform the output of the regex match before it is passed to the parser? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I see now that https://chevrotain.io/docs/guide/custom_token_patterns.html#custom-payloads perfectly describes my use case. I didn't realize this at first glance because it seems to handling a more complex case. |
Beta Was this translation helpful? Give feedback.
I see now that https://chevrotain.io/docs/guide/custom_token_patterns.html#custom-payloads perfectly describes my use case. I didn't realize this at first glance because it seems to handling a more complex case.