Skip to content

Commit 66d80ed

Browse files
committed
use cls_name for super access, rebuild
1 parent 40b7ed6 commit 66d80ed

File tree

7 files changed

+28
-17
lines changed

7 files changed

+28
-17
lines changed

moonscript/cmd/coverage.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ format_file = function(fname, positions)
5858
end
5959
local CodeCoverage
6060
do
61+
local _class_0
6162
local _base_0 = {
6263
reset = function(self)
6364
self.line_counts = create_counter()
@@ -120,7 +121,7 @@ do
120121
end
121122
}
122123
_base_0.__index = _base_0
123-
local _class_0 = setmetatable({
124+
_class_0 = setmetatable({
124125
__init = function(self)
125126
return self:reset()
126127
end,

moonscript/cmd/lint.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ local default_whitelist = Set({
5252
})
5353
local LinterBlock
5454
do
55+
local _class_0
5556
local _parent_0 = Block
5657
local _base_0 = {
5758
lint_mark_used = function(self, name)
@@ -120,11 +121,11 @@ do
120121
end,
121122
render = function(self, ...)
122123
self:lint_check_unused()
123-
return self.__class.__parent.render(self, ...)
124+
return _class_0.__parent.render(self, ...)
124125
end,
125126
block = function(self, ...)
126127
do
127-
local _with_0 = self.__class.__parent.block(self, ...)
128+
local _with_0 = _class_0.__parent.block(self, ...)
128129
_with_0.block = self.block
129130
_with_0.render = self.render
130131
_with_0.get_root_block = self.get_root_block
@@ -138,12 +139,12 @@ do
138139
}
139140
_base_0.__index = _base_0
140141
setmetatable(_base_0, _parent_0.__base)
141-
local _class_0 = setmetatable({
142+
_class_0 = setmetatable({
142143
__init = function(self, whitelist_globals, ...)
143144
if whitelist_globals == nil then
144145
whitelist_globals = default_whitelist
145146
end
146-
self.__class.__parent.__init(self, ...)
147+
_class_0.__parent.__init(self, ...)
147148
self.get_root_block = function()
148149
return self
149150
end

moonscript/compile.lua

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ local mtype = util.moon.type
2626
local indent_char = " "
2727
local Line, DelayedLine, Lines, Block, RootBlock
2828
do
29+
local _class_0
2930
local _base_0 = {
3031
mark_pos = function(self, pos, line)
3132
if line == nil then
@@ -127,7 +128,7 @@ do
127128
end
128129
}
129130
_base_0.__index = _base_0
130-
local _class_0 = setmetatable({
131+
_class_0 = setmetatable({
131132
__init = function(self)
132133
self.posmap = { }
133134
end,
@@ -145,6 +146,7 @@ do
145146
Lines = _class_0
146147
end
147148
do
149+
local _class_0
148150
local _base_0 = {
149151
pos = nil,
150152
append_list = function(self, items, delim)
@@ -208,7 +210,7 @@ do
208210
end
209211
}
210212
_base_0.__index = _base_0
211-
local _class_0 = setmetatable({
213+
_class_0 = setmetatable({
212214
__init = function() end,
213215
__base = _base_0,
214216
__name = "Line"
@@ -224,6 +226,7 @@ do
224226
Line = _class_0
225227
end
226228
do
229+
local _class_0
227230
local _base_0 = {
228231
prepare = function() end,
229232
render = function(self)
@@ -232,7 +235,7 @@ do
232235
end
233236
}
234237
_base_0.__index = _base_0
235-
local _class_0 = setmetatable({
238+
_class_0 = setmetatable({
236239
__init = function(self, fn)
237240
self.prepare = fn
238241
end,
@@ -250,6 +253,7 @@ do
250253
DelayedLine = _class_0
251254
end
252255
do
256+
local _class_0
253257
local _base_0 = {
254258
header = "do",
255259
footer = "end",
@@ -573,7 +577,7 @@ do
573577
end
574578
}
575579
_base_0.__index = _base_0
576-
local _class_0 = setmetatable({
580+
_class_0 = setmetatable({
577581
__init = function(self, parent, header, footer)
578582
self.parent, self.header, self.footer = parent, header, footer
579583
self._lines = Lines()
@@ -613,6 +617,7 @@ do
613617
Block = _class_0
614618
end
615619
do
620+
local _class_0
616621
local _parent_0 = Block
617622
local _base_0 = {
618623
__tostring = function(self)
@@ -634,11 +639,11 @@ do
634639
}
635640
_base_0.__index = _base_0
636641
setmetatable(_base_0, _parent_0.__base)
637-
local _class_0 = setmetatable({
642+
_class_0 = setmetatable({
638643
__init = function(self, options)
639644
self.options = options
640645
self.root = self
641-
return self.__class.__parent.__init(self)
646+
return _class_0.__parent.__init(self)
642647
end,
643648
__base = _base_0,
644649
__name = "RootBlock",

moonscript/data.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Set = function(items)
1414
end
1515
local Stack
1616
do
17+
local _class_0
1718
local _base_0 = {
1819
__tostring = function(self)
1920
return "<Stack {" .. concat(self, ", ") .. "}>"
@@ -34,7 +35,7 @@ do
3435
end
3536
}
3637
_base_0.__index = _base_0
37-
local _class_0 = setmetatable({
38+
_class_0 = setmetatable({
3839
__init = function(self, ...)
3940
self:push(...)
4041
return nil

moonscript/transform.moon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,7 @@ Statement = Transformer {
680680
@set "super", (block, chain) ->
681681
relative_parent = {
682682
"chain",
683-
"self"
684-
{"dot", "__class"}
683+
cls_name
685684
{"dot", "__parent"}
686685
}
687686

@@ -729,6 +728,7 @@ Statement = Transformer {
729728
else
730729
relative_parent
731730

731+
{"declare", { cls_name }}
732732
{"declare_glob", "*"}
733733

734734
parent_val and .assign_one(parent_cls_name, parent_val) or NOOP

moonscript/transform/names.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ local unpack
44
unpack = require("moonscript.util").unpack
55
local LocalName
66
do
7+
local _class_0
78
local _base_0 = {
89
get_name = function(self)
910
return self.name
1011
end
1112
}
1213
_base_0.__index = _base_0
13-
local _class_0 = setmetatable({
14+
_class_0 = setmetatable({
1415
__init = function(self, name)
1516
self.name = name
1617
self[1] = "temp_name"
@@ -30,6 +31,7 @@ do
3031
end
3132
local NameProxy
3233
do
34+
local _class_0
3335
local _base_0 = {
3436
get_name = function(self, scope, dont_put)
3537
if dont_put == nil then
@@ -81,7 +83,7 @@ do
8183
end
8284
}
8385
_base_0.__index = _base_0
84-
local _class_0 = setmetatable({
86+
_class_0 = setmetatable({
8587
__init = function(self, prefix)
8688
self.prefix = prefix
8789
self[1] = "temp_name"

moonscript/transform/statements.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ do
55
end
66
local Run
77
do
8+
local _class_0
89
local _base_0 = {
910
call = function(self, state)
1011
return self.fn(state)
1112
end
1213
}
1314
_base_0.__index = _base_0
14-
local _class_0 = setmetatable({
15+
_class_0 = setmetatable({
1516
__init = function(self, fn)
1617
self.fn = fn
1718
self[1] = "run"

0 commit comments

Comments
 (0)