-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdata.lua
83 lines (83 loc) · 1.41 KB
/
data.lua
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
local concat, remove, insert
do
local _obj_0 = table
concat, remove, insert = _obj_0.concat, _obj_0.remove, _obj_0.insert
end
local Set
Set = function(items)
local _tbl_0 = { }
for _index_0 = 1, #items do
local k = items[_index_0]
_tbl_0[k] = true
end
return _tbl_0
end
local Stack
do
local _class_0
local _base_0 = {
__tostring = function(self)
return "<Stack {" .. concat(self, ", ") .. "}>"
end,
pop = function(self)
return remove(self)
end,
push = function(self, value, ...)
insert(self, value)
if ... then
return self:push(...)
else
return value
end
end,
top = function(self)
return self[#self]
end
}
_base_0.__index = _base_0
_class_0 = setmetatable({
__init = function(self, ...)
self:push(...)
return nil
end,
__base = _base_0,
__name = "Stack"
}, {
__index = _base_0,
__call = function(cls, ...)
local _self_0 = setmetatable({}, _base_0)
cls.__init(_self_0, ...)
return _self_0
end
})
_base_0.__class = _class_0
Stack = _class_0
end
local lua_keywords = Set({
'and',
'break',
'do',
'else',
'elseif',
'end',
'false',
'for',
'function',
'if',
'in',
'local',
'nil',
'not',
'or',
'repeat',
'return',
'then',
'true',
'until',
'while'
})
return {
Set = Set,
Stack = Stack,
lua_keywords = lua_keywords
}