Skip to content

Highlight breaks with constants  #39

@alexr00

Description

@alexr00

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions