X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Fobjc.yaml;h=1a8b7197ec648d071181f4e5b36d79fbeec5521e;hb=ba4b02807627820d741e7e68b75a0818926e9fe6;hp=8f99f57426e953c5d885cc919e136edc8007ac73;hpb=b977bf5cca84f7dc762fe8d9967831502ee5cc87;p=micro.git diff --git a/runtime/syntax/objc.yaml b/runtime/syntax/objc.yaml index 8f99f574..1a8b7197 100644 --- a/runtime/syntax/objc.yaml +++ b/runtime/syntax/objc.yaml @@ -1,6 +1,6 @@ -filetype: Objective-C +filetype: objective-c -detect: +detect: filename: "\\.(m|mm|h)$" rules: @@ -9,26 +9,52 @@ rules: - type: "\\b[A-Z][A-Z][[:alnum:]]*\\b" - type: "\\b[A-Za-z0-9_]*_t\\b" - type: "\\bdispatch_[a-zA-Z0-9_]*_t\\b" - - statement: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__|__unused|_Nonnull|_Nullable|__block|__builtin.*" + + - statement: "(__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__|__unused|_Nonnull|_Nullable|__block|__builtin.*)" - statement: "\\b(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\\b" - statement: "\\b(for|if|while|do|else|case|default|switch)\\b" - statement: "\\b(try|throw|catch|operator|new|delete)\\b" - - special: "\\b(goto|continue|break|return)\\b" + - statement: "\\b(goto|continue|break|return)\\b" - statement: "\\b(nonatomic|atomic|readonly|readwrite|strong|weak|assign)\\b" - statement: "@(encode|end|interface|implementation|class|selector|protocol|synchronized|try|catch|finally|property|optional|required|import|autoreleasepool)" + - preproc: "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma).*$" - preproc: "__[A-Z0-9_]*__" - - special: "^[[:space:]]*[#|@][[:space:]]*(import|include)[[:space:]]*[\\\"|<].*\\/?[>|\\\"][[:space:]]*$" - - symbol.operator: "[.:;,+*|=!\\%\\[\\]]|<|>|/|-|&" - - constant.number: "\\b(-?)?[0-9]+\\b|\\b\\[0-9]+\\.[0-9]+\\b|\\b0x[0-9A-F]+\\b" - - constant: "@\\[(\\\\.|[^\\]])*\\]|@\\{(\\\\.|[^\\}])*\\}|@\\((\\\\.|[^\\)])*\\)" - - constant.bool: "\\b(nil|NULL|YES|NO|TRUE|true|FALSE|false)\\b" - - special: "\\b(self)\\b" + + - special: "^[[:space:]]*[#|@][[:space:]]*(import|include)[[:space:]]*[\"|<].*\\/?[>|\"][[:space:]]*$" + + - statement: "([.:;,+*|=!\\%\\[\\]]|<|>|/|-|&)" + + - constant.number: "(\\b(-?)?[0-9]+\\b|\\b\\[0-9]+\\.[0-9]+\\b|\\b0x[0-9A-F]+\\b)" + - constant: "(@\\[(\\\\.|[^\\]])*\\]|@\\{(\\\\.|[^\\}])*\\}|@\\((\\\\.|[^\\)])*\\))" + - constant: "\\b<(\\\\.[^\\>])*\\>\\b" + - constant: "\\b(nil|NULL|YES|NO|TRUE|true|FALSE|false|self)\\b" - constant: "\\bk[[:alnum]]*\\b" - - constant.string: "\\\"(\\\\.|[^\\\"])*\\\"|@\\\"(\\\\.|[^\\\"])*\\\"|'.'" - - comment: "//.*" + - constant.string: "'.'" + + - constant.string: + start: "@\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + + - constant.string: + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + + - comment: + start: "//" + end: "$" + rules: + - todo: "(TODO|XXX|FIXME):?" + - comment: start: "/\\*" end: "\\*/" - rules: [] + rules: + - todo: "(TODO|XXX|FIXME):?"