You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens regardless whether priority is higher or lower between each other - e.g. commentstart would have 2 instead of 20 and MaybeValue has 20 instead of 2 - effectively ignoring the priority e.g.:
If I add ( to the [^..] exclusive Tokens::MaybeValue then it works but it would be nice if priority can be used to compose regular expression/s over tokens that may match each other.
Looking at the codegen both seem to be treated as regexes but it doesn't explain different priorities not working.
That said the documentation perhaps could be filled out re: limitations if not supported - happy to help doc or send PR/s.
What is curious that if the priority is same you get the warning at least about it matching the same input but given priority is different it probably could be composable grouping.
I think this is part of related to all the bugs with priorities, see also #265, and other related issues.
Sadly, I currently have not time to invest into this problem, but I hope someone smarter than me (and with more free time) can address this in the near future! That would greatly help the project!
I know the regex support is limited but being able to do exclusive regexes would be nice without repeating ?
e.g. in the below I would like to match the token
'('
and stop there not even try the regex below it.Results regex with priority = 2 overriding the priority = 20 token
This happens regardless whether priority is higher or lower between each other - e.g. commentstart would have 2 instead of 20 and MaybeValue has 20 instead of 2 - effectively ignoring the priority e.g.:
If I add
(
to the[^..]
exclusiveTokens::MaybeValue
then it works but it would be nice ifpriority
can be used to compose regular expression/s over tokens that may match each other.Looking at the codegen both seem to be treated as regexes but it doesn't explain different priorities not working.
That said the documentation perhaps could be filled out re: limitations if not supported - happy to help doc or send PR/s.
What is curious that if the priority is same you get the warning at least about it matching the same input but given priority is different it probably could be composable grouping.
Related:
Sidenote
If I write it all regexes then it also works but it would be nice to compose tokens with regexes w/ diff priorites
e.g. this works:
But my preference would be to use tokens where I can and leave regexes where I can't use tokens.
I could always split to different lexer but having to construct & morph diff lexer is time consuming.
The text was updated successfully, but these errors were encountered: