]> git.lizzy.rs Git - micro.git/commitdiff
adding objective-c syntax rules
authorSamantha Marshall <me@samdmarshall.com>
Sun, 13 Nov 2016 23:02:20 +0000 (15:02 -0800)
committerSamantha Marshall <me@samdmarshall.com>
Sun, 13 Nov 2016 23:02:20 +0000 (15:02 -0800)
runtime/syntax/objc.micro [new file with mode: 0644]

diff --git a/runtime/syntax/objc.micro b/runtime/syntax/objc.micro
new file mode 100644 (file)
index 0000000..f4d352d
--- /dev/null
@@ -0,0 +1,37 @@
+## Here is an example for C/C++/Obj-C.
+##
+syntax "Objective-C" "\.(m|mm|h)$"
+
+color type "\b(float|double|CGFloat|id|bool|BOOL|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline|Class|SEL|IMP)\b"
+color type "\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\b"
+color type "\b[A-Z][A-Z][[:alnum:]]*\b"
+color type "\b[A-Za-z0-9_]*_t\b"
+color type "\bdispatch_[a-zA-Z0-9_]*_t\b"
+
+color statement "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" "__unused" "_Nonnull" "_Nullable" "__block" "__builtin.*"
+color statement "\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\b"
+color statement "\b(for|if|while|do|else|case|default|switch)\b"
+color statement "\b(try|throw|catch|operator|new|delete)\b"
+color statement "\b(goto|continue|break|return)\b"
+color statement "\b(nonatomic|atomic|readonly|readwrite|strong|weak|assign)\b"
+color statement "@(encode|end|interface|implementation|class|selector|protocol|synchronized|try|catch|finally|property|optional|required|import|autoreleasepool)"
+
+color preproc "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma).*$"
+color preproc "__[A-Z0-9_]*__"
+
+color special "^[[:space:]]*[#|@][[:space:]]*(import|include)[[:space:]]*[\"|<].*\/?[>|\"][[:space:]]*$"
+
+color statement "[.:;,+*|=!\%\[\]]" "<" ">" "/" "-" "&" 
+
+color constant.number "\b(-?)?[0-9]+\b" "\b\[0-9]+\.[0-9]+\b" "\b0x[0-9A-F]+\b"
+color constant "@\[(\\.|[^\]])*\]" "@\{(\\.|[^\}])*\}" "@\((\\.|[^\)])*\)"
+color constant "\b<(\\.[^\>])*\>\b"
+color constant "\b(nil|NULL|YES|NO|TRUE|true|FALSE|false|self)\b"
+color constant "\bk[[:alnum]]*\b"
+color constant.string "\"(\\.|[^\"])*\"" "@\"(\\.|[^\"])*\"" "'.'"
+
+
+color comment "//.*"
+color comment start="/\*" end="\*/"
+
+