Skip to content

Commit 9a66192

Browse files
committed
rebuild 🐱
1 parent a41637b commit 9a66192

File tree

4 files changed

+24
-180
lines changed

4 files changed

+24
-180
lines changed

moonscript/compile.lua

Lines changed: 12 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ local mtype = util.moon.type
3232
local indent_char = " "
3333
local Line, DelayedLine, Lines, Block, RootBlock
3434
do
35-
local _parent_0 = nil
3635
local _base_0 = {
3736
mark_pos = function(self, pos, line)
3837
if line == nil then
@@ -133,39 +132,24 @@ do
133132
end
134133
}
135134
_base_0.__index = _base_0
136-
if _parent_0 then
137-
setmetatable(_base_0, _parent_0.__base)
138-
end
139135
local _class_0 = setmetatable({
140136
__init = function(self)
141137
self.posmap = { }
142138
end,
143139
__base = _base_0,
144-
__name = "Lines",
145-
__parent = _parent_0
140+
__name = "Lines"
146141
}, {
147-
__index = function(cls, name)
148-
local val = rawget(_base_0, name)
149-
if val == nil and _parent_0 then
150-
return _parent_0[name]
151-
else
152-
return val
153-
end
154-
end,
142+
__index = _base_0,
155143
__call = function(cls, ...)
156144
local _self_0 = setmetatable({}, _base_0)
157145
cls.__init(_self_0, ...)
158146
return _self_0
159147
end
160148
})
161149
_base_0.__class = _class_0
162-
if _parent_0 and _parent_0.__inherited then
163-
_parent_0.__inherited(_parent_0, _class_0)
164-
end
165150
Lines = _class_0
166151
end
167152
do
168-
local _parent_0 = nil
169153
local _base_0 = {
170154
pos = nil,
171155
_append_single = function(self, item)
@@ -237,41 +221,22 @@ do
237221
end
238222
}
239223
_base_0.__index = _base_0
240-
if _parent_0 then
241-
setmetatable(_base_0, _parent_0.__base)
242-
end
243224
local _class_0 = setmetatable({
244-
__init = function(self, ...)
245-
if _parent_0 then
246-
return _parent_0.__init(self, ...)
247-
end
248-
end,
225+
__init = function() end,
249226
__base = _base_0,
250-
__name = "Line",
251-
__parent = _parent_0
227+
__name = "Line"
252228
}, {
253-
__index = function(cls, name)
254-
local val = rawget(_base_0, name)
255-
if val == nil and _parent_0 then
256-
return _parent_0[name]
257-
else
258-
return val
259-
end
260-
end,
229+
__index = _base_0,
261230
__call = function(cls, ...)
262231
local _self_0 = setmetatable({}, _base_0)
263232
cls.__init(_self_0, ...)
264233
return _self_0
265234
end
266235
})
267236
_base_0.__class = _class_0
268-
if _parent_0 and _parent_0.__inherited then
269-
_parent_0.__inherited(_parent_0, _class_0)
270-
end
271237
Line = _class_0
272238
end
273239
do
274-
local _parent_0 = nil
275240
local _base_0 = {
276241
prepare = function() end,
277242
render = function(self)
@@ -280,39 +245,24 @@ do
280245
end
281246
}
282247
_base_0.__index = _base_0
283-
if _parent_0 then
284-
setmetatable(_base_0, _parent_0.__base)
285-
end
286248
local _class_0 = setmetatable({
287249
__init = function(self, fn)
288250
self.prepare = fn
289251
end,
290252
__base = _base_0,
291-
__name = "DelayedLine",
292-
__parent = _parent_0
253+
__name = "DelayedLine"
293254
}, {
294-
__index = function(cls, name)
295-
local val = rawget(_base_0, name)
296-
if val == nil and _parent_0 then
297-
return _parent_0[name]
298-
else
299-
return val
300-
end
301-
end,
255+
__index = _base_0,
302256
__call = function(cls, ...)
303257
local _self_0 = setmetatable({}, _base_0)
304258
cls.__init(_self_0, ...)
305259
return _self_0
306260
end
307261
})
308262
_base_0.__class = _class_0
309-
if _parent_0 and _parent_0.__inherited then
310-
_parent_0.__inherited(_parent_0, _class_0)
311-
end
312263
DelayedLine = _class_0
313264
end
314265
do
315-
local _parent_0 = nil
316266
local _base_0 = {
317267
header = "do",
318268
footer = "end",
@@ -608,9 +558,6 @@ do
608558
end
609559
}
610560
_base_0.__index = _base_0
611-
if _parent_0 then
612-
setmetatable(_base_0, _parent_0.__base)
613-
end
614561
local _class_0 = setmetatable({
615562
__init = function(self, parent, header, footer)
616563
self.parent, self.header, self.footer = parent, header, footer
@@ -638,27 +585,16 @@ do
638585
end
639586
end,
640587
__base = _base_0,
641-
__name = "Block",
642-
__parent = _parent_0
588+
__name = "Block"
643589
}, {
644-
__index = function(cls, name)
645-
local val = rawget(_base_0, name)
646-
if val == nil and _parent_0 then
647-
return _parent_0[name]
648-
else
649-
return val
650-
end
651-
end,
590+
__index = _base_0,
652591
__call = function(cls, ...)
653592
local _self_0 = setmetatable({}, _base_0)
654593
cls.__init(_self_0, ...)
655594
return _self_0
656595
end
657596
})
658597
_base_0.__class = _class_0
659-
if _parent_0 and _parent_0.__inherited then
660-
_parent_0.__inherited(_parent_0, _class_0)
661-
end
662598
Block = _class_0
663599
end
664600
do
@@ -682,9 +618,7 @@ do
682618
end
683619
}
684620
_base_0.__index = _base_0
685-
if _parent_0 then
686-
setmetatable(_base_0, _parent_0.__base)
687-
end
621+
setmetatable(_base_0, _parent_0.__base)
688622
local _class_0 = setmetatable({
689623
__init = function(self, options)
690624
self.options = options
@@ -697,7 +631,7 @@ do
697631
}, {
698632
__index = function(cls, name)
699633
local val = rawget(_base_0, name)
700-
if val == nil and _parent_0 then
634+
if val == nil then
701635
return _parent_0[name]
702636
else
703637
return val
@@ -710,7 +644,7 @@ do
710644
end
711645
})
712646
_base_0.__class = _class_0
713-
if _parent_0 and _parent_0.__inherited then
647+
if _parent_0.__inherited then
714648
_parent_0.__inherited(_parent_0, _class_0)
715649
end
716650
RootBlock = _class_0

moonscript/data.lua

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Set = function(items)
1010
end
1111
local Stack
1212
do
13-
local _parent_0 = nil
1413
local _base_0 = {
1514
__tostring = function(self)
1615
return "<Stack {" .. concat(self, ", ") .. "}>"
@@ -27,9 +26,6 @@ do
2726
end
2827
}
2928
_base_0.__index = _base_0
30-
if _parent_0 then
31-
setmetatable(_base_0, _parent_0.__base)
32-
end
3329
local _class_0 = setmetatable({
3430
__init = function(self, ...)
3531
local _list_0 = {
@@ -42,27 +38,16 @@ do
4238
return nil
4339
end,
4440
__base = _base_0,
45-
__name = "Stack",
46-
__parent = _parent_0
41+
__name = "Stack"
4742
}, {
48-
__index = function(cls, name)
49-
local val = rawget(_base_0, name)
50-
if val == nil and _parent_0 then
51-
return _parent_0[name]
52-
else
53-
return val
54-
end
55-
end,
43+
__index = _base_0,
5644
__call = function(cls, ...)
5745
local _self_0 = setmetatable({}, _base_0)
5846
cls.__init(_self_0, ...)
5947
return _self_0
6048
end
6149
})
6250
_base_0.__class = _class_0
63-
if _parent_0 and _parent_0.__inherited then
64-
_parent_0.__inherited(_parent_0, _class_0)
65-
end
6651
Stack = _class_0
6752
end
6853
local lua_keywords = Set({

moonscript/transform.lua

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,28 @@ local NOOP = {
1515
}
1616
local Run, apply_to_last, is_singular, extract_declarations, expand_elseif_assign, constructor_name, with_continue_listener, Transformer, construct_comprehension, Statement, Accumulator, default_accumulator, implicitly_return, Value
1717
do
18-
local _parent_0 = nil
1918
local _base_0 = {
2019
call = function(self, state)
2120
return self.fn(state)
2221
end
2322
}
2423
_base_0.__index = _base_0
25-
if _parent_0 then
26-
setmetatable(_base_0, _parent_0.__base)
27-
end
2824
local _class_0 = setmetatable({
2925
__init = function(self, fn)
3026
self.fn = fn
3127
self[1] = "run"
3228
end,
3329
__base = _base_0,
34-
__name = "Run",
35-
__parent = _parent_0
30+
__name = "Run"
3631
}, {
37-
__index = function(cls, name)
38-
local val = rawget(_base_0, name)
39-
if val == nil and _parent_0 then
40-
return _parent_0[name]
41-
else
42-
return val
43-
end
44-
end,
32+
__index = _base_0,
4533
__call = function(cls, ...)
4634
local _self_0 = setmetatable({}, _base_0)
4735
cls.__init(_self_0, ...)
4836
return _self_0
4937
end
5038
})
5139
_base_0.__class = _class_0
52-
if _parent_0 and _parent_0.__inherited then
53-
_parent_0.__inherited(_parent_0, _class_0)
54-
end
5540
Run = _class_0
5641
end
5742
apply_to_last = function(stms, fn)
@@ -218,7 +203,6 @@ with_continue_listener = function(body)
218203
}
219204
end
220205
do
221-
local _parent_0 = nil
222206
local _base_0 = {
223207
transform = function(self, scope, node, ...)
224208
if self.seen_nodes[node] then
@@ -253,9 +237,6 @@ do
253237
end
254238
}
255239
_base_0.__index = _base_0
256-
if _parent_0 then
257-
setmetatable(_base_0, _parent_0.__base)
258-
end
259240
local _class_0 = setmetatable({
260241
__init = function(self, transformers)
261242
self.transformers = transformers
@@ -264,27 +245,16 @@ do
264245
})
265246
end,
266247
__base = _base_0,
267-
__name = "Transformer",
268-
__parent = _parent_0
248+
__name = "Transformer"
269249
}, {
270-
__index = function(cls, name)
271-
local val = rawget(_base_0, name)
272-
if val == nil and _parent_0 then
273-
return _parent_0[name]
274-
else
275-
return val
276-
end
277-
end,
250+
__index = _base_0,
278251
__call = function(cls, ...)
279252
local _self_0 = setmetatable({}, _base_0)
280253
cls.__init(_self_0, ...)
281254
return _self_0
282255
end
283256
})
284257
_base_0.__class = _class_0
285-
if _parent_0 and _parent_0.__inherited then
286-
_parent_0.__inherited(_parent_0, _class_0)
287-
end
288258
Transformer = _class_0
289259
end
290260
construct_comprehension = function(inner, clauses)
@@ -1259,7 +1229,6 @@ Statement = Transformer({
12591229
end
12601230
})
12611231
do
1262-
local _parent_0 = nil
12631232
local _base_0 = {
12641233
body_idx = {
12651234
["for"] = 4,
@@ -1320,37 +1289,23 @@ do
13201289
end
13211290
}
13221291
_base_0.__index = _base_0
1323-
if _parent_0 then
1324-
setmetatable(_base_0, _parent_0.__base)
1325-
end
13261292
local _class_0 = setmetatable({
13271293
__init = function(self, accum_name)
13281294
self.accum_name = accum_name or NameProxy("accum")
13291295
self.value_name = NameProxy("value")
13301296
self.len_name = NameProxy("len")
13311297
end,
13321298
__base = _base_0,
1333-
__name = "Accumulator",
1334-
__parent = _parent_0
1299+
__name = "Accumulator"
13351300
}, {
1336-
__index = function(cls, name)
1337-
local val = rawget(_base_0, name)
1338-
if val == nil and _parent_0 then
1339-
return _parent_0[name]
1340-
else
1341-
return val
1342-
end
1343-
end,
1301+
__index = _base_0,
13441302
__call = function(cls, ...)
13451303
local _self_0 = setmetatable({}, _base_0)
13461304
cls.__init(_self_0, ...)
13471305
return _self_0
13481306
end
13491307
})
13501308
_base_0.__class = _class_0
1351-
if _parent_0 and _parent_0.__inherited then
1352-
_parent_0.__inherited(_parent_0, _class_0)
1353-
end
13541309
Accumulator = _class_0
13551310
end
13561311
default_accumulator = function(self, node)

0 commit comments

Comments
 (0)