Commits

Eric Knibbe  committed a05a867

ensures member definitions follow a keyword or comma

  • Participants
  • Parent commits 1857d51

Comments (0)

Files changed (1)

File pygments/lexers/web.py

                 bygroups(Punctuation, Keyword)),
 
             # other
-            (r'(([a-z_][\w.]*=?|[-+*/%<>]|==)(?=\s*\([^)]*\)\s*(::[\w.\s]+)?=>))',
-                Name.Function, 'signature'),
+            (r',', Punctuation, 'commamember'),
             (r'(and|or|not)\b', Operator.Word),
             (r'([a-z_][\w.]*)(\s*::\s*)?([a-z_][\w.]*)?(\s*=(?!=))',
                 bygroups(Name, Punctuation, Name.Label, Operator)),
             (r'[(,]', Punctuation),
             include('whitespacecomments'),
         ],
+        'commamember': [
+            (r'(([a-z_][\w.]*=?|[-+*/%<>]|==)'
+             r'(?=\s*(\(([^()]*\([^()]*\))*[^)]*\)\s*)?(::[\w.\s]+)?=>))',
+                Name.Function, 'signature'),
+            include('whitespacecomments'),
+            (r'', Text, '#pop'),
+        ],
     }
 
     def __init__(self, **options):