Commits

Rob Hoelz  committed b4807a1

Remove extra space next to parenthesis

  • Participants
  • Parent commits 01731e5

Comments (0)

Files changed (1)

File pygments/lexers/agile.py

     # process the corresponding one!
     tokens = {
         'common' : [
-            ( r'#[`|=](?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS.keys()) + r'])(?P=first_char)*)', brackets_callback(Comment.Multiline) ),
-            ( r'#[^\n]*$', Comment.Singleline ),
-            ( 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_RANGE + '+:sym)', bygroups(Keyword, Name), 'token-sym-brackets' ),
-            ( r'(regex|token|rule)(?!' + PERL6_IDENTIFIER_RANGE + ')(\s*' + PERL6_IDENTIFIER_RANGE + '+)?', bygroups(Keyword, Name), 'pre-token' ),
+            (r'#[`|=](?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS.keys()) + r'])(?P=first_char)*)', brackets_callback(Comment.Multiline)),
+            (r'#[^\n]*$', Comment.Singleline),
+            (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_RANGE + '+:sym)', bygroups(Keyword, Name), 'token-sym-brackets'),
+            (r'(regex|token|rule)(?!' + PERL6_IDENTIFIER_RANGE + ')(\s*' + PERL6_IDENTIFIER_RANGE + '+)?', bygroups(Keyword, Name), 'pre-token'),
             # deal with a special case in the Perl 6 grammar (role q { ... })
-            ( r'(role)(\s+)(q)(\s*)', bygroups(Keyword, Text, Name, Text) ),
-            ( _build_word_match(PERL6_KEYWORDS, PERL6_IDENTIFIER_RANGE), Keyword ),
-            ( _build_word_match(PERL6_BUILTIN_CLASSES, PERL6_IDENTIFIER_RANGE, suffix = '(?::[UD])?'), Name.Builtin ),
-            ( _build_word_match(PERL6_BUILTINS, PERL6_IDENTIFIER_RANGE), Name.Builtin),
+            (r'(role)(\s+)(q)(\s*)', bygroups(Keyword, Text, Name, Text)),
+            (_build_word_match(PERL6_KEYWORDS, PERL6_IDENTIFIER_RANGE), Keyword),
+            (_build_word_match(PERL6_BUILTIN_CLASSES, PERL6_IDENTIFIER_RANGE, suffix = '(?::[UD])?'), Name.Builtin),
+            (_build_word_match(PERL6_BUILTINS, PERL6_IDENTIFIER_RANGE), Name.Builtin),
             # copied from PerlLexer
-            ( r'[$@%&][.^:?=!~]?' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable ),
-            ( r'\$[!/](?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable.Global ),
-            ( r'::\?\w+', Name.Variable.Global ),
-            ( r'[$@%&]\*' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable.Global ),
-            ( r'\$(?:<.*?>)+', Name.Variable ),
-            ( r'(?:q|qq|Q)[a-zA-Z]?\s*(?P<adverbs>:[\w\s:]+)?\s*(?P<delimiter>(?P<first_char>[^0-9a-zA-Z:\s])(?P=first_char)*)', brackets_callback(String) ),
+            (r'[$@%&][.^:?=!~]?' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable),
+            (r'\$[!/](?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable.Global),
+            (r'::\?\w+', Name.Variable.Global),
+            (r'[$@%&]\*' + PERL6_IDENTIFIER_RANGE + u'+(?:<<.*?>>|<.*?>|«.*?»)*', Name.Variable.Global),
+            (r'\$(?:<.*?>)+', Name.Variable),
+            (r'(?:q|qq|Q)[a-zA-Z]?\s*(?P<adverbs>:[\w\s:]+)?\s*(?P<delimiter>(?P<first_char>[^0-9a-zA-Z:\s])(?P=first_char)*)', brackets_callback(String)),
             # copied from PerlLexer
-            ( r'0_?[0-7]+(_[0-7]+)*', Number.Oct ),
-            ( r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex ),
-            ( r'0b[01]+(_[01]+)*', Number.Bin ),
-            ( r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?', Number.Float ),
-            ( r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float ),
-            ( r'\d+(_\d+)*', Number.Integer ),
-            ( r'(?<=~~)\s*/(?:\\\\|\\/|.)*?/', String.Regex ),
-            ( r'(?<=[=(,])\s*/(?:\\\\|\\/|.)*?/', String.Regex ),
-            ( r'm\w+(?=\()', Name ),
-            ( r'(?:m|ms|rx)\s*(?P<adverbs>:[\w\s:]+)?\s*(?P<delimiter>(?P<first_char>[^0-9a-zA-Z:\s])(?P=first_char)*)', brackets_callback(String.Regex) ),
-            ( r'(?:s|ss|tr)\s*(?::[\w\s:]+)?\s*/(?:\\\\|\\/|.)*?/(?:\\\\|\\/|.)*?/', String.Regex ),
-            ( r'<[^\s=].*?\S>', String ),
-            ( _build_word_match(PERL6_OPERATORS), Operator ),
-            ( r'[0-9a-zA-Z_]' + PERL6_IDENTIFIER_RANGE + '*', Name ),
-            ( r"'(\\\\|\\[^\\]|[^'\\])*'", String ),
-            ( r'"(\\\\|\\[^\\]|[^"\\])*"', String ),
+            (r'0_?[0-7]+(_[0-7]+)*', Number.Oct),
+            (r'0x[0-9A-Fa-f]+(_[0-9A-Fa-f]+)*', Number.Hex),
+            (r'0b[01]+(_[01]+)*', Number.Bin),
+            (r'(?i)(\d*(_\d*)*\.\d+(_\d*)*|\d+(_\d*)*\.\d+(_\d*)*)(e[+-]?\d+)?', Number.Float),
+            (r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float),
+            (r'\d+(_\d+)*', Number.Integer),
+            (r'(?<=~~)\s*/(?:\\\\|\\/|.)*?/', String.Regex),
+            (r'(?<=[=(,])\s*/(?:\\\\|\\/|.)*?/', String.Regex),
+            (r'm\w+(?=\()', Name),
+            (r'(?:m|ms|rx)\s*(?P<adverbs>:[\w\s:]+)?\s*(?P<delimiter>(?P<first_char>[^0-9a-zA-Z:\s])(?P=first_char)*)', brackets_callback(String.Regex)),
+            (r'(?:s|ss|tr)\s*(?::[\w\s:]+)?\s*/(?:\\\\|\\/|.)*?/(?:\\\\|\\/|.)*?/', String.Regex),
+            (r'<[^\s=].*?\S>', String),
+            (_build_word_match(PERL6_OPERATORS), Operator),
+            (r'[0-9a-zA-Z_]' + PERL6_IDENTIFIER_RANGE + '*', Name),
+            (r"'(\\\\|\\[^\\]|[^'\\])*'", String),
+            (r'"(\\\\|\\[^\\]|[^"\\])*"', String),
         ],
         'root' : [
             include('common'),
-            ( r'\{', opening_brace_callback ),
-            ( r'\}', closing_brace_callback ),
-            ( r'.+?', Text ),
+            (r'\{', opening_brace_callback),
+            (r'\}', closing_brace_callback),
+            (r'.+?', Text),
         ],
         'pre-token' : [
             include('common'),
-            ( r'\{', Text, ( '#pop', 'token' ) ),
-            ( r'.+?', Text ),
+            (r'\{', Text, ('#pop', 'token')),
+            (r'.+?', Text),
         ],
         'token-sym-brackets' : [
-            ( r'(?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS.keys()) + '])(?P=first_char)*)', brackets_callback(Name), ( '#pop', 'pre-token' ) ),
-            ( r'.', Name, ( '#pop', 'pre-token' ) ),
+            (r'(?P<delimiter>(?P<first_char>[' + ''.join(PERL6_BRACKETS.keys()) + '])(?P=first_char)*)', brackets_callback(Name), ('#pop', 'pre-token')),
+            (r'.', Name, ('#pop', 'pre-token')),
         ],
         # the tokens state rules are defined after the class body, for reasons
         # explained below.
 # we have to define these here because we have to be able to refer to
 # the Perl6Lexer class
 Perl6Lexer.tokens['token'] = [
-    ( r'}', Text, '#pop' ),
-    ( r'(?<=:)(?:my|our|state|constant|temp|let).*?;', using(Perl6Lexer) ),
+    (r'}', Text, '#pop'),
+    (r'(?<=:)(?:my|our|state|constant|temp|let).*?;', using(Perl6Lexer)),
     # make sure that quotes in character classes aren't treated as strings
-    ( r'<(?:[-!?+.]\s*)?\[.*?\]>', String.Regex ),
+    (r'<(?:[-!?+.]\s*)?\[.*?\]>', String.Regex),
     # make sure that '#' characters in quotes aren't treated as comments
-    ( r"(?<!\\)'(\\\\|\\[^\\]|[^'\\])*'", String.Regex ),
-    ( r'(?<!\\)"(\\\\|\\[^\\]|[^"\\])*"', String.Regex ),
-    ( r'#.*?$', Comment.Singleline ),
-    ( r'\{', embedded_perl6_callback ),
-    ( '.+?', String.Regex ),
+    (r"(?<!\\)'(\\\\|\\[^\\]|[^'\\])*'", String.Regex),
+    (r'(?<!\\)"(\\\\|\\[^\\]|[^"\\])*"', String.Regex),
+    (r'#.*?$', Comment.Singleline),
+    (r'\{', embedded_perl6_callback),
+    ('.+?', String.Regex),
 ]