Adding a custom lexer rule without overriding current rules. #340
kafkiansky
started this conversation in
General
Replies: 3 comments 2 replies
-
There's no way to "inherit" from the default lexer as it's actually the default Go one. |
Beta Was this translation helpful? Give feedback.
0 replies
-
That probably wasn't very clear, sorry. By "default Go one" I mean it just uses text/scanner under the hood, so it is completely unrelated to Participle's regex-based lexer. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You could probably combine them by implementing a combining lexer. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to add a custom rule, but so that I don't have to specify all existing rules. Code example:
However, now I get an error:
mapper:(participle.Mapper)(0x10e0240)} uses unknown token "String"
Beta Was this translation helpful? Give feedback.
All reactions