summaryrefslogtreecommitdiff
path: root/tests/examplefiles
diff options
context:
space:
mode:
authorthatch <devnull@localhost>2008-08-13 21:26:50 -0700
committerthatch <devnull@localhost>2008-08-13 21:26:50 -0700
commit290d8e5ea5bc60cca765efb53867a73fa7bb0ef4 (patch)
treeb81f01103a143d0f4935bff4f1695c6b2dd81f46 /tests/examplefiles
parente226a0c052265321640ee474d63b1118cb65c036 (diff)
downloadpygments-290d8e5ea5bc60cca765efb53867a73fa7bb0ef4.tar.gz
Bring Objective C lexer up to date with 2.0 features
(properties and so-called "fast enumerations")
Diffstat (limited to 'tests/examplefiles')
-rw-r--r--tests/examplefiles/objc_example.m11
-rw-r--r--tests/examplefiles/objc_example2.m24
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/examplefiles/objc_example.m b/tests/examplefiles/objc_example.m
new file mode 100644
index 00000000..c2a1c414
--- /dev/null
+++ b/tests/examplefiles/objc_example.m
@@ -0,0 +1,11 @@
+#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]);
+}
+
diff --git a/tests/examplefiles/objc_example2.m b/tests/examplefiles/objc_example2.m
new file mode 100644
index 00000000..8cd9b060
--- /dev/null
+++ b/tests/examplefiles/objc_example2.m
@@ -0,0 +1,24 @@
+// MyClass.h
+@interface MyClass : NSObject
+{
+ NSString *value;
+ NSTextField *textField;
+@private
+ NSDate *lastModifiedDate;
+}
+@property(copy, readwrite) NSString *value;
+@property(retain) IBOutlet NSTextField *textField;
+@end
+
+// MyClass.m
+// Class extension to declare private property
+@interface MyClass ()
+@property(retain) NSDate *lastModifiedDate;
+@end
+
+@implementation MyClass
+@synthesize value;
+@synthesize textField;
+@synthesize lastModifiedDate;
+// implementation continues
+@end