]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/lua.yaml
Merge pull request #613 from GeigerCounter/build_tools
[micro.git] / runtime / syntax / lua.yaml
1 filetype: lua
2
3 detect:
4     filename: "\\.lua$"
5
6 rules:
7     - statement: "\\b(do|end|while|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)\\b"
22     - constant: "\\b(false|nil|true)\\b"
23     - statement: "(\\b(dofile|require|include)|%q|%!|%Q|%r|%x)\\b"
24     - constant.number: "\\b([0-9]+)\\b"
25     - symbol: "(\\(|\\)|\\[|\\]|\\{|\\}|\\*\\*|\\*|/|%|\\+|-|\\^|>|>=|<|<=|~=|=|\\.\\.|#)"
26
27     - constant.string:
28         start: "\""
29         end: "\""
30         skip: "\\\\."
31         rules:
32             - constant.specialChar: "\\\\."
33
34     - constant.string:
35         start: "'"
36         end: "'"
37         skip: "\\\\."
38         rules:
39             - constant.specialChar: "\\\\."
40
41     - constant.string:
42         start: "\\[\\["
43         end: "\\]\\]"
44         rules:
45             - constant.specialChar: "\\\\."
46
47     - special: "\\\\[0-7][0-7][0-7]|\\\\x[0-9a-fA-F][0-9a-fA-F]|\\\\[abefnrs]|(\\\\c|\\\\C-|\\\\M-|\\\\M-\\\\C-)."
48
49     - comment: 
50         start: "\\-\\-"
51         end: "$"
52         rules: []
53
54     - comment: 
55         start: "\\-\\-\\[\\["
56         end: "\\]\\]"
57         rules: []
58