Commits

Rob Hoelz  committed ff20ebd

Make sure that token identifiers followed by :sym are properly consumed

The regex for matching token identifiers wasn't working properly and would
never match the tokens following :sym

  • Participants
  • Parent commits e874187

Comments (0)

Files changed (1)

File pygments/lexers/agile.py

             ( 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.replace(':', '') + '])(\s*[' + PERL6_IDENTIFIER_CHARS.replace(':', '') + ']+(?::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 ),