X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Fc.yaml;h=15310ee82053fced3984192caa4b0597e3591a20;hb=120cd02b309c32a6f9ce7893b4000c9b29dcb9ac;hp=3c653d187625cd639a80284456753e9a694aeefe;hpb=75329830f9c6bc0f45b2e9d2e15592524032c084;p=micro.git diff --git a/runtime/syntax/c.yaml b/runtime/syntax/c.yaml index 3c653d18..15310ee8 100644 --- a/runtime/syntax/c.yaml +++ b/runtime/syntax/c.yaml @@ -4,23 +4,19 @@ detect: filename: "(\\.(c|C)$|\\.(h|H)$|\\.ii?$|\\.(def)$)" rules: - - identifier: "\\b[A-Z_][0-9A-Z_]+\\b" + - identifier: "\\b[A-Z_][0-9A-Z_]+\\b" - type: "\\b(float|double|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\\b" - type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b" - type.extended: "\\b(bool)\\b" - - statement: "\\b(typename|mutable|volatile|register|explicit)\\b" + - statement: "\\b(volatile|register)\\b" - statement: "\\b(for|if|while|do|else|case|default|switch)\\b" - - statement: "\\b(try|throw|catch|operator|delete)\\b" - statement: "\\b(goto|continue|break|return)\\b" - preproc: "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)" - - constant: "'([^'\\\\]|(\\\\[\"'abfnrtv\\\\]))'" - - constant: "'\\\\(([0-3]?[0-7]{1,2}))'" - - constant: "'\\\\x[0-9A-Fa-f]{1,2}'" # GCC builtins - statement: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)" - statement: "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" # Operator Color - - symbol.operator: "([.:;,+*|=!\\%]|<|>|/|-|&)" + - symbol.operator: "([.:;,+*|=!\\%]|<|>|/|-|&)" - symbol.brackets: "[(){}]|\\[|\\]" - constant.number: "(\\b[0-9]+\\b|\\b0x[0-9A-Fa-f]+\\b)" - constant.number: "NULL" @@ -30,15 +26,15 @@ rules: end: "\"" skip: "\\\\." rules: - - constant.specialChar: "\\\\." + - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})" - constant.string: start: "'" end: "'" skip: "\\\\." rules: - - preproc: "..+" - - constant.specialChar: "\\\\." + - error: "..+" + - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})" - comment: start: "//" @@ -51,4 +47,3 @@ rules: end: "\\*/" rules: - todo: "(TODO|XXX|FIXME):?" -