]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/objc.yaml
Case-insensitive highlighting of hexadecimal constants
[micro.git] / runtime / syntax / objc.yaml
1 filetype: objective-c
2
3 detect:
4     filename: "\\.(m|mm|h)$"
5
6 rules:
7     - 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"
8     - type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b"
9     - type: "\\b[A-Z][A-Z][[:alnum:]]*\\b"
10     - type: "\\b[A-Za-z0-9_]*_t\\b"
11     - type: "\\bdispatch_[a-zA-Z0-9_]*_t\\b"
12
13     - statement: "(__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__|__unused|_Nonnull|_Nullable|__block|__builtin.*)"
14     - statement: "\\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\\b"
15     - statement: "\\b(for|if|while|do|else|case|default|switch)\\b"
16     - statement: "\\b(try|throw|catch|operator|new|delete)\\b"
17     - statement: "\\b(goto|continue|break|return)\\b"
18     - statement: "\\b(nonatomic|atomic|readonly|readwrite|strong|weak|assign)\\b"
19     - statement: "@(encode|end|interface|implementation|class|selector|protocol|synchronized|try|catch|finally|property|optional|required|import|autoreleasepool)"
20
21     - preproc: "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma).*$"
22     - preproc: "__[A-Z0-9_]*__"
23
24     - special: "^[[:space:]]*[#|@][[:space:]]*(import|include)[[:space:]]*[\"|<].*\\/?[>|\"][[:space:]]*$"
25
26     - statement: "([.:;,+*|=!\\%\\[\\]]|<|>|/|-|&)"
27
28     - constant.number: "(\\b(-?)?[0-9]+\\b|\\b\\[0-9]+\\.[0-9]+\\b|\\b0x[0-9a-fA-F]+\\b)"
29     - constant: "(@\\[(\\\\.|[^\\]])*\\]|@\\{(\\\\.|[^\\}])*\\}|@\\((\\\\.|[^\\)])*\\))"
30     - constant: "\\b<(\\\\.[^\\>])*\\>\\b"
31     - constant: "\\b(nil|NULL|YES|NO|TRUE|true|FALSE|false|self)\\b"
32     - constant: "\\bk[[:alnum]]*\\b"
33     - constant.string: "'.'"
34
35     - constant.string:
36         start: "@\""
37         end: "\""
38         skip: "\\\\."
39         rules:
40             - constant.specialChar: "\\\\."
41
42     - constant.string:
43         start: "\""
44         end: "\""
45         skip: "\\\\."
46         rules:
47             - constant.specialChar: "\\\\."
48
49     - comment:
50         start: "//"
51         end: "$"
52         rules:
53             - todo: "(TODO|XXX|FIXME):?"
54
55     - comment:
56         start: "/\\*"
57         end: "\\*/"
58         rules:
59             - todo: "(TODO|XXX|FIXME):?"