Commits

Tim Hatch  committed cf9152b Merge
  • Participants
  • Parent commits b07bba9, 95f157b

Comments (0)

Files changed (2)

File pygments/lexers/compiled.py

             ],
             'oc_classname' : [
                 # interface definition that inherits
+                ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*:\s*)([a-zA-Z$_][a-zA-Z0-9$_]*)?(\s*)({)',
+                 bygroups(Name.Class, Text, Name.Class, Text, Punctuation), ('#pop', 'oc_ivars')),
                 ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*:\s*)([a-zA-Z$_][a-zA-Z0-9$_]*)?',
                  bygroups(Name.Class, Text, Name.Class), '#pop'),
                 # interface definition for a category
+                ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*)(\([a-zA-Z$_][a-zA-Z0-9$_]*\))(\s*)({)',
+                 bygroups(Name.Class, Text, Name.Label, Text, Punctuation), ('#pop', 'oc_ivars')),
                 ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*)(\([a-zA-Z$_][a-zA-Z0-9$_]*\))',
                  bygroups(Name.Class, Text, Name.Label), '#pop'),
                 # simple interface / implementation
+                ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*)({)',
+                 bygroups(Name.Class, Text, Punctuation), ('#pop', 'oc_ivars')),
                 ('([a-zA-Z$_][a-zA-Z0-9$_]*)', Name.Class, '#pop')
             ],
             'oc_forward_classname' : [
               ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*;?)',
                bygroups(Name.Class, Text), '#pop')
             ],
+            'oc_ivars' : [
+              include('whitespace'),
+              include('statements'),
+              (';', Punctuation),
+              ('{', Punctuation, '#push'),
+              ('}', Punctuation, '#pop'),
+            ],
             'root': [
               # methods
               (r'^([-+])(\s*)'                         # method marker

File tests/examplefiles/objc_example2.m

 @synthesize lastModifiedDate;
 // implementation continues
 @end
+
++ (void)f1:(NSString *)s1;
++ (void)f2:(NSString *)s2;