-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpr-enum.lua
More file actions
40 lines (39 loc) · 764 Bytes
/
Copy pathcpr-enum.lua
File metadata and controls
40 lines (39 loc) · 764 Bytes
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
Enumerator = Class("Enumerator", {
cpr = function(self, wt, indent)
wt:add(self.cid or self.id)
if self.value then
wt:add(" = ")
self.value:cpr(wt, indent)
end
end,
},
function(E, self)
--idump(self)
if self.value then
disown(self.value)
end
return self
end)
Enum = Class("Enum", {
cpr = function(self, wt, indent)
wt:add("enum ", self.cid or self.id)
if #self > 0 then
local indent2 = indent .. " "
wt:add(" {\n")
for k, v in ipairs(self) do
wt:add(indent2)
v:cpr(wt, indent2)
wt:add(",\n")
end
wt:add(indent, "}")
end
end,
},
function(E, self)
--idump(self)
disown(self.ctype)
for k, v in ipairs(self) do
disown(v)
end
return self
end)