From ac41e186a02f5f2ab07bb364868657037f5f0ad2 Mon Sep 17 00:00:00 2001 From: sum01 Date: Sun, 31 Dec 2017 00:37:11 -0500 Subject: [PATCH] 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):?"