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

Perl highlighting issue in regexp with newer (perl 5.20) modifiers #1325

Closed
gullevek opened this issue Nov 24, 2017 · 0 comments · Fixed by #2048
Closed

Perl highlighting issue in regexp with newer (perl 5.20) modifiers #1325

gullevek opened this issue Nov 24, 2017 · 0 comments · Fixed by #2048

Comments

@gullevek
Copy link

It seems that a lot of the new modifiers in the perl regex are not supported. Like /p, /xx, /a, /d, /l, /u, /n, /r

When using one of those in a perl regex it will break any code highlighting after this regex.

Also simple match =~ // highlighting seems to be a bit broken

Below compare shot between vim and Sublime Text 3 built 3143

screen shot 2017-11-24 at 14 28 05
screen shot 2017-11-24 at 14 28 14

TheClams pushed a commit to TheClams/Packages that referenced this issue May 10, 2018
Fix issue sublimehq#541 with  space at the beginnign of a regexp
Fix issue sublimehq#1495 and sublimehq#1594 where // can break the syntax highlighting
Fix issue sublimehq#1325 and sublimehq#1029 related to regexp modifier

Fix issue sublimehq#1326 with variable starting with underscore
deathaxe added a commit to deathaxe/sublime-packages that referenced this issue May 11, 2018
Fixes sublimehq#541, sublimehq#1029, sublimehq#1325, sublimehq#1326, sublimehq#1495

Supersedes sublimehq#1556

According to sublimehq#481 this commit provides an Oniguruma free Perl syntax
definition written from scratch.

OUTLINE

  1. fixes all currently open issues
  2. much more feature complete
  3. completely compatible with new regex engine
  4. uses embed to include custom syntaxes within
     POD and HEREDOCS (CSS,JS,JSON,HTML,SQL,XML)
  5. provides a syntax test file
  6. uses as much atomic rules from Perl.sublime-syntax and
     ModernPerl package as possible (with some fixes/modifications)
  7. follows the doc http://perldoc.perl.org as close as possible
  8. add some snippets with some files renamed to match naming style

REMARKS

1. The benchmark tests on a 100k file with all kinds of statements
   output about 360ms for evaluation on a Windows box.

2. The main focus is to create a robust base for syntax highlighting
   rather than scoping each language entity/construct in detail.

   a) Not all meta scoping RFCs are implemented in detail due to
      some limitations caused by HEREDOC. Especially pushing in/out
      of `meta.block` or `meta.braces` breaks some HEREDOC constructs.

   b) Scope names were changed to follow the scope naming guidelines
      as close as possible and try to use as general names as possible.
      -> Maybe needs some refines?

3. At the current point the implementation is a work in progress and
   needs testing by perl power users to

   a) check for highlighting to work in all situations

   b) constants/variables/functions are scoped correctly

4. This commit adds some snippets but does not include any completions
   in favor of https://packagecontrol.io/packages/Perl%20Completions
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

Successfully merging a pull request may close this issue.

1 participant