-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Textmate engine bug for \k<>
backreferences
#193
Comments
Oh interesting, I suppose
I'd argue that for both
Many existing syntaxes, like Ruby and Shell, would break if that reference-groups-from-the-start feature never worked. Just cause a feature is hard to manually use doesn't make it being broken a non-issue.
I agree which is why I never count capture groups, I made the ruby grammer builder do the heavy lifting. Some C++ patterns have over 100 capture groups so it would've been unrealistic for me to maintain any other way. |
Example of working as expected
Input is on the left, output is on the right.
The "end" pattern is referencing the 2nd group created in "begin" (the EOF)
What (intentional) failure looks like (non-issue)
A bad pattern causes this kind of behavior:
(note: yellow is the theme's color for
entity.shell
, which is the included pattern)What is broken
\k<2>
should be equivlent to\2
and in other places it does behave equivlentlyHowever, instead of failing normally (e.g. all-yellow) it seems to trigger undefined behavior:
(Note:
\2
is not a viable workaround when group numbers are ≥10)Here's the code for the problematic pattern.
This is for VS Code 1.72.2, on Mac M1
The text was updated successfully, but these errors were encountered: