]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/objc.micro
Merge pull request #447 from samdmarshall/objective-c-syntax
[micro.git] / runtime / syntax / objc.micro
1 ## Here is an example for Obj-C.
2 ##
3 syntax "Objective-C" "\.(m|mm|h)$"
4
5 color type "\b(float|double|CGFloat|id|bool|BOOL|Boolean|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline|Class|SEL|IMP|NS(U)?Integer)\b"
6 color type "\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\b"
7 color type "\b[A-Z][A-Z][[:alnum:]]*\b"
8 color type "\b[A-Za-z0-9_]*_t\b"
9 color type "\bdispatch_[a-zA-Z0-9_]*_t\b"
10
11 color statement "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" "__unused" "_Nonnull" "_Nullable" "__block" "__builtin.*"
12 color statement "\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\b"
13 color statement "\b(for|if|while|do|else|case|default|switch)\b"
14 color statement "\b(try|throw|catch|operator|new|delete)\b"
15 color statement "\b(goto|continue|break|return)\b"
16 color statement "\b(nonatomic|atomic|readonly|readwrite|strong|weak|assign)\b"
17 color statement "@(encode|end|interface|implementation|class|selector|protocol|synchronized|try|catch|finally|property|optional|required|import|autoreleasepool)"
18
19 color preproc "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma).*$"
20 color preproc "__[A-Z0-9_]*__"
21
22 color special "^[[:space:]]*[#|@][[:space:]]*(import|include)[[:space:]]*[\"|<].*\/?[>|\"][[:space:]]*$"
23
24 color statement "[.:;,+*|=!\%\[\]]" "<" ">" "/" "-" "&" 
25
26 color constant.number "\b(-?)?[0-9]+\b" "\b\[0-9]+\.[0-9]+\b" "\b0x[0-9A-F]+\b"
27 color constant "@\[(\\.|[^\]])*\]" "@\{(\\.|[^\}])*\}" "@\((\\.|[^\)])*\)"
28 color constant "\b<(\\.[^\>])*\>\b"
29 color constant "\b(nil|NULL|YES|NO|TRUE|true|FALSE|false|self)\b"
30 color constant "\bk[[:alnum]]*\b"
31 color constant.string "\"(\\.|[^\"])*\"" "@\"(\\.|[^\"])*\"" "'.'"
32
33
34 color comment "//.*"
35 color comment start="/\*" end="\*/"
36
37