diff --git a/moonscript/cmd/coverage.lua b/moonscript/cmd/coverage.lua index 8c585e8..4fd3680 100644 --- a/moonscript/cmd/coverage.lua +++ b/moonscript/cmd/coverage.lua @@ -58,6 +58,7 @@ format_file = function(fname, positions) end local CodeCoverage do + local _class_0 local _base_0 = { reset = function(self) self.line_counts = create_counter() @@ -120,7 +121,7 @@ do end } _base_0.__index = _base_0 - local _class_0 = setmetatable({ + _class_0 = setmetatable({ __init = function(self) return self:reset() end, diff --git a/moonscript/cmd/lint.lua b/moonscript/cmd/lint.lua index 3a109a3..50509e5 100644 --- a/moonscript/cmd/lint.lua +++ b/moonscript/cmd/lint.lua @@ -52,6 +52,7 @@ local default_whitelist = Set({ }) local LinterBlock do + local _class_0 local _parent_0 = Block local _base_0 = { lint_mark_used = function(self, name) @@ -120,11 +121,11 @@ do end, render = function(self, ...) self:lint_check_unused() - return self.__class.__parent.render(self, ...) + return _class_0.__parent.render(self, ...) end, block = function(self, ...) do - local _with_0 = self.__class.__parent.block(self, ...) + local _with_0 = _class_0.__parent.block(self, ...) _with_0.block = self.block _with_0.render = self.render _with_0.get_root_block = self.get_root_block @@ -138,12 +139,12 @@ do } _base_0.__index = _base_0 setmetatable(_base_0, _parent_0.__base) - local _class_0 = setmetatable({ + _class_0 = setmetatable({ __init = function(self, whitelist_globals, ...) if whitelist_globals == nil then whitelist_globals = default_whitelist end - self.__class.__parent.__init(self, ...) + _class_0.__parent.__init(self, ...) self.get_root_block = function() return self end diff --git a/moonscript/compile.lua b/moonscript/compile.lua index dad4b79..0715b86 100644 --- a/moonscript/compile.lua +++ b/moonscript/compile.lua @@ -26,6 +26,7 @@ local mtype = util.moon.type local indent_char = " " local Line, DelayedLine, Lines, Block, RootBlock do + local _class_0 local _base_0 = { mark_pos = function(self, pos, line) if line == nil then @@ -127,7 +128,7 @@ do end } _base_0.__index = _base_0 - local _class_0 = setmetatable({ + _class_0 = setmetatable({ __init = function(self) self.posmap = { } end, @@ -145,6 +146,7 @@ do Lines = _class_0 end do + local _class_0 local _base_0 = { pos = nil, append_list = function(self, items, delim) @@ -208,7 +210,7 @@ do end } _base_0.__index = _base_0 - local _class_0 = setmetatable({ + _class_0 = setmetatable({ __init = function() end, __base = _base_0, __name = "Line" @@ -224,6 +226,7 @@ do Line = _class_0 end do + local _class_0 local _base_0 = { prepare = function() end, render = function(self) @@ -232,7 +235,7 @@ do end } _base_0.__index = _base_0 - local _class_0 = setmetatable({ + _class_0 = setmetatable({ __init = function(self, fn) self.prepare = fn end, @@ -250,6 +253,7 @@ do DelayedLine = _class_0 end do + local _class_0 local _base_0 = { header = "do", footer = "end", @@ -573,7 +577,7 @@ do end } _base_0.__index = _base_0 - local _class_0 = setmetatable({ + _class_0 = setmetatable({ __init = function(self, parent, header, footer) self.parent, self.header, self.footer = parent, header, footer self._lines = Lines() @@ -613,6 +617,7 @@ do Block = _class_0 end do + local _class_0 local _parent_0 = Block local _base_0 = { __tostring = function(self) @@ -634,11 +639,11 @@ do } _base_0.__index = _base_0 setmetatable(_base_0, _parent_0.__base) - local _class_0 = setmetatable({ + _class_0 = setmetatable({ __init = function(self, options) self.options = options self.root = self - return self.__class.__parent.__init(self) + return _class_0.__parent.__init(self) end, __base = _base_0, __name = "RootBlock", diff --git a/moonscript/data.lua b/moonscript/data.lua index 2e159c8..f33f708 100644 --- a/moonscript/data.lua +++ b/moonscript/data.lua @@ -14,6 +14,7 @@ Set = function(items) end local Stack do + local _class_0 local _base_0 = { __tostring = function(self) return "" @@ -34,7 +35,7 @@ do end } _base_0.__index = _base_0 - local _class_0 = setmetatable({ + _class_0 = setmetatable({ __init = function(self, ...) self:push(...) return nil diff --git a/moonscript/transform.moon b/moonscript/transform.moon index 5db3b5d..5cd9ec1 100644 --- a/moonscript/transform.moon +++ b/moonscript/transform.moon @@ -680,8 +680,7 @@ Statement = Transformer { @set "super", (block, chain) -> relative_parent = { "chain", - "self" - {"dot", "__class"} + cls_name {"dot", "__parent"} } @@ -729,6 +728,7 @@ Statement = Transformer { else relative_parent + {"declare", { cls_name }} {"declare_glob", "*"} parent_val and .assign_one(parent_cls_name, parent_val) or NOOP diff --git a/moonscript/transform/names.lua b/moonscript/transform/names.lua index c74a377..b498036 100644 --- a/moonscript/transform/names.lua +++ b/moonscript/transform/names.lua @@ -4,13 +4,14 @@ local unpack unpack = require("moonscript.util").unpack local LocalName do + local _class_0 local _base_0 = { get_name = function(self) return self.name end } _base_0.__index = _base_0 - local _class_0 = setmetatable({ + _class_0 = setmetatable({ __init = function(self, name) self.name = name self[1] = "temp_name" @@ -30,6 +31,7 @@ do end local NameProxy do + local _class_0 local _base_0 = { get_name = function(self, scope, dont_put) if dont_put == nil then @@ -81,7 +83,7 @@ do end } _base_0.__index = _base_0 - local _class_0 = setmetatable({ + _class_0 = setmetatable({ __init = function(self, prefix) self.prefix = prefix self[1] = "temp_name" diff --git a/moonscript/transform/statements.lua b/moonscript/transform/statements.lua index 169590e..994df89 100644 --- a/moonscript/transform/statements.lua +++ b/moonscript/transform/statements.lua @@ -5,13 +5,14 @@ do end local Run do + local _class_0 local _base_0 = { call = function(self, state) return self.fn(state) end } _base_0.__index = _base_0 - local _class_0 = setmetatable({ + _class_0 = setmetatable({ __init = function(self, fn) self.fn = fn self[1] = "run"