diff --git a/runtime/syntax/julia.yaml b/runtime/syntax/julia.yaml index 77bf7016..b00a8fa8 100644 --- a/runtime/syntax/julia.yaml +++ b/runtime/syntax/julia.yaml @@ -13,7 +13,7 @@ rules: # definitions - identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]" # keywords - - statement: "\\b(begin|break|catch|continue|function|elseif|else|end|finally|for|global|local|if|include|using|require|macro|println|return|try|type|while|module)\\b" + - statement: "\\b(begin|break|catch|continue|function|elseif|else|end|finally|for|global|local|const|if|include|using|require|macro|println|return|try|type|while|module)\\b" # decorators - identifier.macro: "@[A-Za-z0-9_]+" # operators diff --git a/runtime/syntax/lua.yaml b/runtime/syntax/lua.yaml index 3ee256e1..cb1ee24e 100644 --- a/runtime/syntax/lua.yaml +++ b/runtime/syntax/lua.yaml @@ -18,11 +18,12 @@ rules: - identifier: "coroutine\\.\\b(create|isyieldable|resume|running|status|wrap|yield)\\b" - identifier: "debug\\.\\b(debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|getuservalue|setfenv|sethook|setlocal|setmetatable|setupvalue|setuservalue|traceback|upvalueid|upvaluejoin)\\b" - identifier: "bit32\\.\\b(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)\\b" - - identifier: "\\:\\b(close|flush|lines|read|seek|setvbuf|write)\\b" + - identifier: "\\:\\b(close|flush|lines|read|seek|setvbuf|write|byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)\\b" + - identifier: "\\b(self|arg)\\b" - constant: "\\b(false|nil|true)\\b" - statement: "(\\b(dofile|require|include)|%q|%!|%Q|%r|%x)\\b" - constant.number: "\\b([0-9]+)\\b" - - symbol: "(\\(|\\)|\\[|\\]|\\{|\\}|\\*\\*|\\*|/|%|\\+|-|\\^|>|>=|<|<=|~=|=|\\.\\.|#)" + - symbol: "(\\(|\\)|\\[|\\]|\\{|\\}|\\*\\*|\\*|/|%|\\+|-|\\^|>|>=|<|<=|~=|=|[\\.]{2,3}|#)" - constant.string: start: "\"" @@ -50,11 +51,12 @@ rules: start: "\\-\\-\\[(\\=*|\\#*)\\[" end: "\\-\\-\\](\\=*|\\#*)\\]" rules: - - todo: "(TODO|XXX|FIXME):?" + - todo: "(TODO|NOTE|FIXME):?" # this has to go after block comment or block comment does not work - comment: start: "\\-\\-" end: "$" - rules: [] \ No newline at end of file + rules: + - todo: "(TODO|NOTE|FIXME):?" diff --git a/runtime/syntax/micro.yaml b/runtime/syntax/micro.yaml index 8c84ffdf..276fb092 100644 --- a/runtime/syntax/micro.yaml +++ b/runtime/syntax/micro.yaml @@ -6,13 +6,25 @@ detect: rules: - statement: "\\b(syntax|color(-link)?)\\b" - statement: "\\b(start=|end=)\\b" - - identifier: "\\b(default|comment|symbol|identifier|constant(.string(.char)?|.number)?|statement|preproc|type|special|underlined|error|todo|statusline|indent-char|(current-)?line-number|gutter-error|gutter-warning|cursor-line|color-column)\\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: start: "#" end: "$" - rules: [] + rules: + - todo: "(FIXME|TODO|NOTE):?" - constant.string: start: "\"" end: "\"" @@ -20,4 +32,3 @@ rules: rules: - constant.specialChar: "\\\\." - constant.number: "#[0-9 A-F a-f]+" -