From 0ba60728e8cddbb43811f10fd9c9f5556db88e94 Mon Sep 17 00:00:00 2001 From: mbesancon Date: Fri, 29 Dec 2017 13:08:21 -0500 Subject: [PATCH 1/3] added const for julia const is a base keyword --- runtime/syntax/julia.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 7867d50d67141e9f69114cde28b1299fc7d783e1 Mon Sep 17 00:00:00 2001 From: sum01 Date: Sat, 30 Dec 2017 11:47:39 -0500 Subject: [PATCH 2/3] Fix micro file syntax Some of the words were missing, so this adds those. --- runtime/syntax/micro.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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]+" - From ac41e186a02f5f2ab07bb364868657037f5f0ad2 Mon Sep 17 00:00:00 2001 From: sum01 Date: Sun, 31 Dec 2017 00:37:11 -0500 Subject: [PATCH 3/3] Add some Lua syntax (#962) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add some missing Lua string syntax All Lua strings have the string functions inside of them. '...you can use the string functions in object-oriented style' See '6.4 – String Manipulation' in https://www.lua.org/manual/5.3/manual.html * Lua - Highlight self and TODO/NOTE/FIXME * Add Lua 'arg' and triple-dot syntax --- runtime/syntax/lua.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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):?"