forked from leafo/moonscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.lua
More file actions
90 lines (90 loc) · 1.72 KB
/
data.lua
File metadata and controls
90 lines (90 loc) · 1.72 KB
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
module("moonscript.data", package.seeall)
local concat = table.concat
Set = function(items)
local self = { }
local _list_0 = items
for _index_0 = 1, #_list_0 do
local key = _list_0[_index_0]
self[key] = true
end
return self
end
Stack = (function()
local _parent_0 = nil
local _base_0 = {
__tostring = function(self)
return "<Stack {" .. concat(self, ", ") .. "}>"
end,
pop = function(self)
return table.remove(self)
end,
push = function(self, value)
table.insert(self, value)
return value
end,
top = function(self)
return self[#self]
end
}
_base_0.__index = _base_0
if _parent_0 then
setmetatable(_base_0, _parent_0.__base)
end
local _class_0 = setmetatable({
__init = function(self, ...)
local _list_0 = {
...
}
for _index_0 = 1, #_list_0 do
local v = _list_0[_index_0]
self:push(v)
end
return nil
end,
__base = _base_0,
__name = "Stack",
__parent = _parent_0
}, {
__index = function(cls, name)
local val = rawget(_base_0, name)
if val == nil and _parent_0 then
return _parent_0[name]
else
return val
end
end,
__call = function(cls, ...)
local _self_0 = setmetatable({}, _base_0)
cls.__init(_self_0, ...)
return _self_0
end
})
_base_0.__class = _class_0
if _parent_0 and _parent_0.__inherited then
_parent_0.__inherited(_parent_0, _class_0)
end
return _class_0
end)()
lua_keywords = Set({
'and',
'break',
'do',
'else',
'elseif',
'end',
'false',
'for',
'function',
'if',
'in',
'local',
'nil',
'not',
'or',
'repeat',
'return',
'then',
'true',
'until',
'while'
})