diff --git a/mode/perl.py b/mode/perl.py index a22f253..31f6842 100644 --- a/mode/perl.py +++ b/mode/perl.py @@ -42,7 +42,7 @@ wchr2 = '[a-zA-Z0-9_]' wchr3 = '[-a-zA-Z0-9_]' hword = wchr3 + '+' word1 = wchr1 + wchr2 + '*' -word2 = '(?:' + word1 + '::)*' + word1 +word2 = '(?:' + word1 + "(?:'|::))*" + word1 pname = '[.a-zA-Z0-9_]+' def _make_string_rules(forbidden): @@ -149,7 +149,7 @@ class PerlGrammar(Grammar): MatchGrammar6, r'\>[a-z]*'), # match regexes - RegionRule('perl.match', r'(?:(?<==~)|(?<=!~)|(?<=\()|(?<=split)|(?<=if)|(?<=unless)|(?<=while)|(?<=until)|(?<=\|\|)) *(?P/)', MatchGrammar1, '/[a-z]*'), + RegionRule('perl.match', r'(?:(?<==~)|(?<=!~)|(?<=\()|(?<=split)|(?<=if)|(?<=unless)|(?<=while)|(?<=until)|(?<=\|\|)|(?<=&&)|(?<==)) *(?P/)', MatchGrammar1, '/[a-z]*'), RegionRule('perl.match', 'm *(?P/)', MatchGrammar1, '/[a-z]*'), RegionRule('perl.match', 'm *(?P[^ #a-zA-Z0-9_])', StringGrammar, '%(delim)s[a-z]*'), @@ -222,7 +222,7 @@ class PerlGrammar(Grammar): PatternRule('perl.function', word2 + r"(?= *\()"), PatternRule('perl.class', word2 + "(?=->)"), - PatternRule('perl.glob', r'(?:(?<=[^a-zA-Z0-9_])|(?<=^)) *\*[^ ]+'), + PatternRule('perl.glob', r'(?:(?<=[^a-zA-Z0-9_])|(?<=^)) *\*' + word2), # some basic stuff PatternRule('delimiter', r"::|->|=>|(?