Commits

Rob Hoelz committed aa7b9ed

Make sure that words containing 'regex' aren't highlighted as a keyword

  • Participants
  • Parent commits a8bcbf9

Comments (0)

Files changed (1)

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)(\s*[' + PERL6_IDENTIFIER_CHARS + ']+:sym<.*?>)?(.*?)([{])', bygroups(Keyword, Name, Name, Text), 'token' ),
+            ( r'(regex|token|rule)(?![' + PERL6_IDENTIFIER_CHARS + '])(\s*[' + PERL6_IDENTIFIER_CHARS + ']+:sym<.*?>)?(.*?)([{])', bygroups(Keyword, Name, Name, Text), '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 ),