7 - statement: "\\b(do|end|while|break|repeat|until|if|elseif|then|else|for|in|function|local|return)\\b"
8 - statement: "\\b(not|and|or)\\b"
9 - statement: "\\b(debug|string|math|table|io|coroutine|os|utf8|bit32)\\b\\."
10 - statement: "\\b(_ENV|_G|_VERSION|assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\s*\\("
11 - identifier: "io\\.\\b(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)\\b"
12 - identifier: "math\\.\\b(abs|acos|asin|atan2|atan|ceil|cosh|cos|deg|exp|floor|fmod|frexp|huge|ldexp|log10|log|max|maxinteger|min|mininteger|modf|pi|pow|rad|random|randomseed|sinh|sqrt|tan|tointeger|type|ult)\\b"
13 - identifier: "os\\.\\b(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)\\b"
14 - identifier: "package\\.\\b(config|cpath|loaded|loadlib|path|preload|seeall|searchers|searchpath)\\b"
15 - identifier: "string\\.\\b(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)\\b"
16 - identifier: "table\\.\\b(concat|insert|maxn|move|pack|remove|sort|unpack)\\b"
17 - identifier: "utf8\\.\\b(char|charpattern|codes|codepoint|len|offset)\\b"
18 - identifier: "coroutine\\.\\b(create|isyieldable|resume|running|status|wrap|yield)\\b"
19 - identifier: "debug\\.\\b(debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|getuservalue|setfenv|sethook|setlocal|setmetatable|setupvalue|setuservalue|traceback|upvalueid|upvaluejoin)\\b"
20 - identifier: "bit32\\.\\b(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)\\b"
21 - 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"
22 - identifier: "\\b(self|arg)\\b"
23 - constant: "\\b(false|nil|true)\\b"
24 - statement: "(\\b(dofile|require|include)|%q|%!|%Q|%r|%x)\\b"
25 - constant.number: "\\b([0-9]+)\\b"
26 - symbol.brackets: "[(){}\\[\\]]"
27 - symbol: "(\\*|//|/|%|\\+|-|\\^|>|>=|<|<=|~=|=|[\\.]{2,3}|#)"
34 - constant.specialChar: "\\\\."
41 - constant.specialChar: "\\\\."
47 - constant.specialChar: "\\\\."
49 # support first few lengths of "long brackets" explicitly
50 # brackets longer than that will give false positives
56 - constant.specialChar: "\\\\."
62 - constant.specialChar: "\\\\."
68 - constant.specialChar: "\\\\."
74 - constant.specialChar: "\\\\."
76 - special: "\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]|\\\\[abefnrs]|(\\\\c|\\\\C-|\\\\M-|\\\\M-\\\\C-)."
82 - todo: "(TODO|NOTE|FIXME):?"
84 # support long brackets, same as with multiline strings
87 start: "\\-\\-\\[=\\["
90 - todo: "(TODO|NOTE|FIXME):?"
93 start: "\\-\\-\\[==\\["
96 - todo: "(TODO|NOTE|FIXME):?"
99 start: "\\-\\-\\[===\\["
102 - todo: "(TODO|NOTE|FIXME):?"
105 start: "\\-\\-\\[====+\\["
108 - todo: "(TODO|NOTE|FIXME):?"
110 # this has to go after block comment or block comment does not work
116 - todo: "(TODO|NOTE|FIXME):?"