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

Highlight breaks with constants #39

Open
alexr00 opened this issue Sep 24, 2019 · 0 comments
Open

Highlight breaks with constants #39

alexr00 opened this issue Sep 24, 2019 · 0 comments

Comments

@alexr00
Copy link

alexr00 commented Sep 24, 2019

From @AlexTalker in microsoft/vscode#81309

  • VSCode Version: 1.38.1
  • OS Version: Windows_NT x64 10.0.17763

Steps to Reproduce:

  1. Create a perl module like this:
use v5.10;
use strict;
use warning;

use constant FOO => 42;

my $x = 33;
$x = $x << FOO;

say($x);
  1. Notice that after utilization of FOO, color highlight breaks:
    image

Does this issue occur when all extensions are disabled?: Yes

The problem seems to be that this regular expression https://github.com/textmate/perl.tmbundle/blob/master/Syntaxes/Perl.plist#L2080 breaks rules of Perl syntax:

The terminating string may be either an identifier (a word), or some quoted text. An unquoted identifier works like double quotes. There may not be a space between the << and the identifier, unless the identifier is explicitly quoted. The terminating string must appear by itself (unquoted and with no surrounding white-space) on the terminating line.

https://perldoc.perl.org/perlop.html#Quote-and-Quote-like-Operators

As it consumes a white-spaces successfully.
I don't know who's to blame here, so I make the issue here and you can if necessary duplicate it to TextMate project.

On huge projects, it is really annoying to break syntax of a large file by simple usage of a constant.

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

1 participant