Skip to content
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

Regular expression breaks syntax highlighting #52

Open
alexr00 opened this issue Jul 11, 2022 · 3 comments
Open

Regular expression breaks syntax highlighting #52

alexr00 opened this issue Jul 11, 2022 · 3 comments

Comments

@alexr00
Copy link

alexr00 commented Jul 11, 2022

Regular expression breaks syntax highlighting for remainder of the file. The offending line (perl) is here:

if ((($var, $val) = /^\s*([_a-zA-Z0-9]+)\s*=\s*(.*)/) != 2) {

The *'s after each \s seem to be relevant; deleting one fixes the formatting (but deleting two breaks it again).

Steps to Reproduce:

  1. Do above
  2. See error

Originally from @zaharazod in microsoft/vscode#154706

@alexr00
Copy link
Author

alexr00 commented Jul 11, 2022

Looking at the highlighter code
It looks like regex strings can only come after (, {, ~, &, |, if, unless or a newline.
in your example, the regex is after a =, which isn't supported
image

As a temp work around, you can just surround the regex with brackets (or any of the other valid character)
image

Or add = to the list of allowed characters
image
image

<string>(?&lt;=\(|\{|~|&amp;|\||if|unless|^)\s*((\/))</string>

Should make report to: https://github.com/textmate/perl.tmbundle

Originally from @RedCMD in microsoft/vscode#154706

@zaharazod
Copy link

zaharazod commented Jul 11, 2022 via email

@RedCMD
Copy link

RedCMD commented Aug 16, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants