diff options
author | Rob Hoelz <rob@hoelz.ro> | 2013-03-22 23:01:06 +0100 |
---|---|---|
committer | Rob Hoelz <rob@hoelz.ro> | 2013-03-22 23:01:06 +0100 |
commit | fcdf857b2a53f44c454efe770d930bf67a2cbd96 (patch) | |
tree | 96c40ddd9677c94fc0ca3fe78e6aa0df1005fd22 /pygments/lexers/agile.py | |
parent | 1fd088dc8a3d6d2152c6cb3d3c51224759489868 (diff) | |
download | pygments-fcdf857b2a53f44c454efe770d930bf67a2cbd96.tar.gz |
Make the :sym following a token identifer optional
The previous regex had a bug where it would only consume an identifier
following the token/regex/rule keyword if it ended in :sym. This caused
some token names to be improperly highlighted
Diffstat (limited to 'pygments/lexers/agile.py')
-rw-r--r-- | pygments/lexers/agile.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pygments/lexers/agile.py b/pygments/lexers/agile.py index 685b622a..8a5229cd 100644 --- a/pygments/lexers/agile.py +++ b/pygments/lexers/agile.py @@ -2164,7 +2164,7 @@ class Perl6Lexer(ExtendedRegexLexer): ( r'^(\s*)=begin\s+(\w+)\b.*?^\1=end\s+\2', Comment.Multiline ), ( r'^(\s*)=for.*?\n\s*?\n', Comment.Multiline ), ( r'^=.*?\n\s*?\n', Comment.Multiline ), - ( r'(regex|token|rule)(?![' + PERL6_IDENTIFIER_CHARS + '])(\s*[' + PERL6_IDENTIFIER_CHARS + ']+:sym<.*?>)?', bygroups(Keyword, Name), 'pre-token' ), + ( r'(regex|token|rule)(?![' + PERL6_IDENTIFIER_CHARS + '])(\s*[' + PERL6_IDENTIFIER_CHARS + ']+(?::sym<.*?>)?)?', bygroups(Keyword, Name), 'pre-token' ), # deal with a special class in the Perl 6 grammar (role q { ... }) ( r'(role)(\s*)(q)(\s*)', bygroups(Keyword, Text, Name, Text) ), ( _build_word_match(PERL6_KEYWORDS, PERL6_IDENTIFIER_CHARS), Keyword ), |