Anonymous avatar Anonymous committed 7bbbb6b

Bring Objective C lexer up to date with 2.0 features
(properties and so-called "fast enumerations")

Comments (0)

Files changed (3)


             (r'[()\[\],.]', Punctuation),
-             r'switch|typedef|union|volatile|virtual|while|@selector|'
+             r'switch|typedef|union|volatile|virtual|while|in|@selector|'
-             r'@synchronized|@try|@throw|@catch|@finally|@end)\b', Keyword),
+             r'@synchronized|@try|@throw|@catch|@finally|@end|@property|'
+             r'@synthesize|@dynamic)\b', Keyword),
              r'id|BOOL|IBOutlet|IBAction|SEL)\b', Keyword.Type),
             (r'(_{0,2}inline|naked|restrict|thread|typename)\b', Keyword.Reserved),


+#import "Somefile.h"
+NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
+    @"quattuor", @"four", @"quinque", @"five", @"sex", @"six", nil];
+NSString *key;
+for (key in dictionary) {
+    NSLog(@"English: %@, Latin: %@", key, [dictionary valueForKey:key]);


+// MyClass.h
+@interface MyClass : NSObject
+    NSString *value;
+    NSTextField *textField;
+    NSDate *lastModifiedDate;
+@property(copy, readwrite) NSString *value;
+@property(retain) IBOutlet NSTextField *textField;
+// MyClass.m
+// Class extension to declare private property
+@interface MyClass ()
+@property(retain) NSDate *lastModifiedDate;
+@implementation MyClass
+@synthesize value;
+@synthesize textField;
+@synthesize lastModifiedDate;
+// implementation continues
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.