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