diff --git a/mode/perl.py b/mode/perl.py index cd054d4..833f084 100644 --- a/mode/perl.py +++ b/mode/perl.py @@ -60,15 +60,11 @@ scalar_rules = [ PatternRule('perl.hash', r"\%\$*" + word2), PatternRule('perl.hash', r'\$' + word2 + '(?= *\{)'), - PatternRule('perl.scalar', r'\$[_ab&`\'\+\*\./|,\\";#\%=\-~\^:\?!@\$<>()\[\]](?!' + wchr2 + ')'), + PatternRule('perl.scalar', r'\$[_ab&`\'\+\*\.|,\\";#\%=\-~\^:\?!@\$<>()\[\]](?!' + wchr2 + ')'), PatternRule('perl.scalar', r'\$\d+(?!' + wchr2 +')'), PatternRule('perl.scalar', r'\$\^(?:' + word1 + '|' + wchr1 + ')'), PatternRule('perl.scalar', r'\$\^O'), PatternRule('perl.scalar', r'\${\^' + word1 + '}'), - - PatternRule('perl.scalar', r"\$[\[\]<>ab/'\"_@\?#\$!%^|&*()](?!" + wchr2 + ")"), - PatternRule('perl.scalar', r"\$[0-9]+"), - PatternRule('perl.scalar', r"\$\$*" + word2), ] def _make_string_rules(forbidden): @@ -162,6 +158,8 @@ PerlGrammar.rules = [ PatternRule('perl.function', r"\$\$*" + word2 + "(?=-> *\()"), + # special scalar; doesn't interpolate well + PatternRule('perl.scalar', r'\$/'), ] + scalar_rules + [ # match regexes; paired delimiters