atom / language-perl

Perl package for Atom
Other
25 stars 32 forks source link

Highlights entire file as regex if regex is followed by '?' #74

Open alexchandel opened 8 years ago

alexchandel commented 8 years ago

Consider the following legal Perl program:

$_ = $_ =~ /this never ends/i? "still highlighted": "still highlighted";

print "$_\n";

Unless there's a space between the regex's i flag and ? that begins the ternary operation, Perl highlights the rest of the file as a regex. Even GitHub's trash highlighter does this apparently.

Tellingly, the following variation is mishighlighted the same way:

$_ = $_ =~ /this never ends/? "still highlighted": "still highlighted";

print "$_\n";