Commits

Rob Hoelz committed 7d05755

Refactor most rules out into 'common' state

  • Participants
  • Parent commits ff0e4cc

Comments (0)

Files changed (1)

pygments/lexers/agile.py

     # Perl 6 code in regex blocks), so if you need to process one of them, make sure you also
     # process the corresponding one!
     tokens = {
-        'root' : [
+        'common' : [
             ( r'#[`|=](?P<delimiter>[' + ''.join(PERL6_BRACKETS.keys()) + ']+)', brackets_callback(Comment.Multiline) ),
             ( r'#[^\n]*$', Comment.Singleline ),
             ( r'^(\s*)=begin\s+(\w+)\b.*?^\1=end\s+\2', Comment.Multiline ),
             ( r'[0-9a-zA-Z_][' + PERL6_IDENTIFIER_CHARS + ']*', Name ),
             ( r"'(\\\\|\\[^\\]|[^'\\])*'", String ),
             ( r'"(\\\\|\\[^\\]|[^"\\])*"', String ),
+        ],
+        'root' : [
+            include('common'),
             ( r'[{]', opening_brace_callback ),
             ( r'[}]', closing_brace_callback ),
             ( r'.+?', Text ),