exclude text when match until newline #1051
-
If I want to match names in this format:
But I don't want to match
I tried using this code, but it will be an infinite loop:
So how to exclude
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@Yokozuna59 The language you're building doesn't seem to be tokenizable by just using Regexp. Chevrotain doesn't support positive lookbehind as of now, so you're best approach would be to override the |
Beta Was this translation helpful? Give feedback.
never mind, I figured it out. I didn't know it was possible to add
Cardinalities
to a single parse rule.Anyway for anyone who might ask for it here is the code (because I'll delete the repo):
Langium grammer:
Override
TokenBuilder
: