X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Fmicro.yaml;h=276fb092b40c908b6ba7cbc5b655716931b174aa;hb=54c23cae72d7237bc898a59f79aad0acffdf0ffe;hp=22f5d4f1f2edec886a3cd3776aab53d5ac128400;hpb=b977bf5cca84f7dc762fe8d9967831502ee5cc87;p=micro.git diff --git a/runtime/syntax/micro.yaml b/runtime/syntax/micro.yaml index 22f5d4f1..276fb092 100644 --- a/runtime/syntax/micro.yaml +++ b/runtime/syntax/micro.yaml @@ -1,17 +1,34 @@ filetype: micro -detect: +detect: filename: "\\.(micro)$" rules: - statement: "\\b(syntax|color(-link)?)\\b" - - type.keyword: "\\b(start=|end=)\\b" - - identifier: "\\b(default|comment|symbol(.brackets|.tag)?|identifier|constant(.string(.char)?|.bool|.specialChar|.number)?|statement|preproc|type|special|underlined|error|todo|statusline|indent-char|(current-)?line-number|gutter-error|gutter-warning|cursor-line|color-column|tabbar)\\b" - - preproc: "\\b(syntax|header)\\b" + - statement: "\\b(start=|end=)\\b" + # Simple one-liners + - identifier: "\\b(default|number|statement|underlined|error|todo|statusline|indent-char|cursor\\-line|color\\-column|ignore|divider|tabbar)\\b" + # Separate identifiers to keep "complex" regex clean + - identifier: "\\b(special(Char)?)\\b" + - identifier: "\\b((current\\-)?line\\-number)\\b" + - identifier: "\\b(gutter\\-(info|error|warning){1})\\b" + - identifier: "\\b(comment(\\.bright)?)\\b" + - identifier: "\\b(symbol(\\.(brackets|operator|tag))?)\\b" + - identifier: "\\b(identifier(\\.(class|macro|var))?)\\b" + - identifier: "\\b(constant(\\.(bool(\\.(true|false){1})?|number|specialChar|string(\\.url)?){1})?)\\b" + - identifier: "\\b(preproc(\\.shebang)?)\\b" + - identifier: "\\b(type(\\.keyword)?)\\b" - constant.number: "\\b(|h|A|0x)+[0-9]+(|h|A)+\\b" - constant.number: "\\b0x[0-9 a-f A-F]+\\b" - - comment: "#.*$" - - comment.bright: "##.*$" - - constant.string: "\"(\\\\.|[^\"])*\"" - - constant.number: "#[0-9 A-F a-f]{1,6}" - - comment: "^#.*$" + - comment: + start: "#" + end: "$" + rules: + - todo: "(FIXME|TODO|NOTE):?" + - constant.string: + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + - constant.number: "#[0-9 A-F a-f]+"