Commits

Christian Eager  committed f2fbf63

Update Objective-C lexer and tests with NSArray, NSDictionary, and NSNumber literals

  • Participants
  • Parent commits 157c9fe

Comments (0)

Files changed (2)

File pygments/lexers/compiled.py

                  ('#pop', 'oc_classname')),
                 (r'(@class|@protocol)(\s+)', bygroups(Keyword, Text),
                  ('#pop', 'oc_forward_classname')),
+                (r'@[\[{(]', Punctuation),
                 inherit,
             ],
             'oc_classname' : [

File tests/examplefiles/objc_example.m

     NSLog(@"English: %@, Latin: %@", key, [dictionary valueForKey:key]);
 }
 
+// Literals
+NSArray *a = @[ @"1", @"2" ];
+
+NSDictionary *d = @{ @"key": @"value" };
+
+NSNumber *n1 = @( 1 );
+NSNumber *n2 = @( [a length] );