Commit c76f777d94399e2a9c1013d32d2414de445ff7f5

Tzu-ping Chung 2014-06-25T21:35:03

Add Objective-C syntax

1
2
3
4
5
6
7
8
9
10
11
diff --git a/components/prism-objc.js b/components/prism-objc.js
new file mode 100644
index 0000000..ed85ea2
--- /dev/null
+++ b/components/prism-objc.js
@@ -0,0 +1,5 @@
+Prism.languages.objc = Prism.languages.extend('c', {
+  'keyword': /(\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b)|((?=[\w|@])(@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b)/g,
+  'string': /(?:("|')(\\?.)*?\1)|(?:@"(\\?.)*?")/g,
+  'operator': /[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|\~|\^|\%|@/g,
+});