File: lua.yaml

package info (click to toggle)
micro 2.0.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,828 kB
  • sloc: sh: 247; makefile: 77; xml: 53
file content (111 lines) | stat: -rw-r--r-- 4,300 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
filetype: lua

detect:
    filename: "\\.lua$"

rules:
    - statement: "\\b(do|end|while|break|repeat|until|if|elseif|then|else|for|in|function|local|return|goto)\\b"
    - statement: "\\b(not|and|or)\\b"
    - statement: "\\b(debug|string|math|table|io|coroutine|os|utf8|bit32)\\b\\."
    - 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*\\("
    - identifier: "io\\.\\b(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)\\b"
    - 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|sin|sqrt|tan|tointeger|type|ult)\\b"
    - identifier: "os\\.\\b(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)\\b"
    - identifier: "package\\.\\b(config|cpath|loaded|loadlib|path|preload|seeall|searchers|searchpath)\\b"
    - identifier: "string\\.\\b(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)\\b"
    - identifier: "table\\.\\b(concat|insert|maxn|move|pack|remove|sort|unpack)\\b"
    - identifier: "utf8\\.\\b(char|charpattern|codes|codepoint|len|offset)\\b"
    - 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|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"

    - symbol.brackets: "[(){}\\[\\]]"
    - symbol: "(\\*|//|/|%|\\+|-|\\^|>|>=|<|<=|~=|=|[\\.]{2,3}|#)"

    - constant.number: "\\b((0[xX](([0-9A-Fa-f]+\\.[0-9A-Fa-f]*)|(\\.?[0-9A-Fa-f]+))([pP][-+]?[0-9]+)?)|((([0-9]+\\.[0-9]*)|(\\.?[0-9]+))([eE][-+]?[0-9]+)?))"

    - constant.string:
        start: "\""
        end: "\""
        skip: "\\\\."
        rules:
            - constant.specialChar: "\\\\([abfnrtvz\\'\"]|[0-9]{1,3}|x[0-9a-fA-F][0-9a-fA-F]|u\\{[0-9a-fA-F]+\\})"

    - constant.string:
        start: "'"
        end: "'"
        skip: "\\\\."
        rules:
            - constant.specialChar: "\\\\([abfnrtvz\\'\"]|[0-9]{1,3}|x[0-9a-fA-F][0-9a-fA-F]|u\\{[0-9a-fA-F]+\\})"

    - constant.string:
        start: "\\[\\["
        end: "\\]\\]"
        rules: []

# support first few lengths of "long brackets" explicitly
# brackets longer than that will give false positives

    - constant.string:
        start: "\\[=\\["
        end: "\\]=\\]"
        rules: []

    - constant.string:
        start: "\\[==\\["
        end: "\\]==\\]"
        rules: []

    - constant.string:
        start: "\\[===\\["
        end: "\\]===\\]"
        rules: []

    - constant.string:
        start: "\\[====+\\["
        end: "\\]====+\\]"
        rules: []

    - comment.block:
        start: "\\-\\-\\[\\["
        end: "\\]\\]"
        rules:
            - todo: "(TODO|NOTE|FIXME):?"

# support long brackets, same as with multiline strings

    - comment.block:
        start: "\\-\\-\\[=\\["
        end: "\\]=\\]"
        rules:
            - todo: "(TODO|NOTE|FIXME):?"

    - comment.block:
        start: "\\-\\-\\[==\\["
        end: "\\]==\\]"
        rules:
            - todo: "(TODO|NOTE|FIXME):?"

    - comment.block:
        start: "\\-\\-\\[===\\["
        end: "\\]===\\]"
        rules:
            - todo: "(TODO|NOTE|FIXME):?"

    - comment.block:
        start: "\\-\\-\\[====+\\["
        end: "\\]====+\\]"
        rules:
            - todo: "(TODO|NOTE|FIXME):?"

# this has to go after block comment or block comment does not work

    - comment:
        start: "\\-\\-"
        end: "$"
        rules:
            - todo: "(TODO|NOTE|FIXME):?"