use cls_name for super access, rebuild

This commit is contained in:
leaf corcoran 2015-11-19 22:02:19 -08:00
parent 40b7ed6135
commit 66d80ed217
7 changed files with 28 additions and 17 deletions

View File

@ -58,6 +58,7 @@ format_file = function(fname, positions)
end end
local CodeCoverage local CodeCoverage
do do
local _class_0
local _base_0 = { local _base_0 = {
reset = function(self) reset = function(self)
self.line_counts = create_counter() self.line_counts = create_counter()
@ -120,7 +121,7 @@ do
end end
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
local _class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self) __init = function(self)
return self:reset() return self:reset()
end, end,

View File

@ -52,6 +52,7 @@ local default_whitelist = Set({
}) })
local LinterBlock local LinterBlock
do do
local _class_0
local _parent_0 = Block local _parent_0 = Block
local _base_0 = { local _base_0 = {
lint_mark_used = function(self, name) lint_mark_used = function(self, name)
@ -120,11 +121,11 @@ do
end, end,
render = function(self, ...) render = function(self, ...)
self:lint_check_unused() self:lint_check_unused()
return self.__class.__parent.render(self, ...) return _class_0.__parent.render(self, ...)
end, end,
block = function(self, ...) block = function(self, ...)
do do
local _with_0 = self.__class.__parent.block(self, ...) local _with_0 = _class_0.__parent.block(self, ...)
_with_0.block = self.block _with_0.block = self.block
_with_0.render = self.render _with_0.render = self.render
_with_0.get_root_block = self.get_root_block _with_0.get_root_block = self.get_root_block
@ -138,12 +139,12 @@ do
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
setmetatable(_base_0, _parent_0.__base) setmetatable(_base_0, _parent_0.__base)
local _class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, whitelist_globals, ...) __init = function(self, whitelist_globals, ...)
if whitelist_globals == nil then if whitelist_globals == nil then
whitelist_globals = default_whitelist whitelist_globals = default_whitelist
end end
self.__class.__parent.__init(self, ...) _class_0.__parent.__init(self, ...)
self.get_root_block = function() self.get_root_block = function()
return self return self
end end

View File

@ -26,6 +26,7 @@ local mtype = util.moon.type
local indent_char = " " local indent_char = " "
local Line, DelayedLine, Lines, Block, RootBlock local Line, DelayedLine, Lines, Block, RootBlock
do do
local _class_0
local _base_0 = { local _base_0 = {
mark_pos = function(self, pos, line) mark_pos = function(self, pos, line)
if line == nil then if line == nil then
@ -127,7 +128,7 @@ do
end end
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
local _class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self) __init = function(self)
self.posmap = { } self.posmap = { }
end, end,
@ -145,6 +146,7 @@ do
Lines = _class_0 Lines = _class_0
end end
do do
local _class_0
local _base_0 = { local _base_0 = {
pos = nil, pos = nil,
append_list = function(self, items, delim) append_list = function(self, items, delim)
@ -208,7 +210,7 @@ do
end end
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
local _class_0 = setmetatable({ _class_0 = setmetatable({
__init = function() end, __init = function() end,
__base = _base_0, __base = _base_0,
__name = "Line" __name = "Line"
@ -224,6 +226,7 @@ do
Line = _class_0 Line = _class_0
end end
do do
local _class_0
local _base_0 = { local _base_0 = {
prepare = function() end, prepare = function() end,
render = function(self) render = function(self)
@ -232,7 +235,7 @@ do
end end
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
local _class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, fn) __init = function(self, fn)
self.prepare = fn self.prepare = fn
end, end,
@ -250,6 +253,7 @@ do
DelayedLine = _class_0 DelayedLine = _class_0
end end
do do
local _class_0
local _base_0 = { local _base_0 = {
header = "do", header = "do",
footer = "end", footer = "end",
@ -573,7 +577,7 @@ do
end end
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
local _class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, parent, header, footer) __init = function(self, parent, header, footer)
self.parent, self.header, self.footer = parent, header, footer self.parent, self.header, self.footer = parent, header, footer
self._lines = Lines() self._lines = Lines()
@ -613,6 +617,7 @@ do
Block = _class_0 Block = _class_0
end end
do do
local _class_0
local _parent_0 = Block local _parent_0 = Block
local _base_0 = { local _base_0 = {
__tostring = function(self) __tostring = function(self)
@ -634,11 +639,11 @@ do
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
setmetatable(_base_0, _parent_0.__base) setmetatable(_base_0, _parent_0.__base)
local _class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, options) __init = function(self, options)
self.options = options self.options = options
self.root = self self.root = self
return self.__class.__parent.__init(self) return _class_0.__parent.__init(self)
end, end,
__base = _base_0, __base = _base_0,
__name = "RootBlock", __name = "RootBlock",

View File

@ -14,6 +14,7 @@ Set = function(items)
end end
local Stack local Stack
do do
local _class_0
local _base_0 = { local _base_0 = {
__tostring = function(self) __tostring = function(self)
return "<Stack {" .. concat(self, ", ") .. "}>" return "<Stack {" .. concat(self, ", ") .. "}>"
@ -34,7 +35,7 @@ do
end end
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
local _class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, ...) __init = function(self, ...)
self:push(...) self:push(...)
return nil return nil

View File

@ -680,8 +680,7 @@ Statement = Transformer {
@set "super", (block, chain) -> @set "super", (block, chain) ->
relative_parent = { relative_parent = {
"chain", "chain",
"self" cls_name
{"dot", "__class"}
{"dot", "__parent"} {"dot", "__parent"}
} }
@ -729,6 +728,7 @@ Statement = Transformer {
else else
relative_parent relative_parent
{"declare", { cls_name }}
{"declare_glob", "*"} {"declare_glob", "*"}
parent_val and .assign_one(parent_cls_name, parent_val) or NOOP parent_val and .assign_one(parent_cls_name, parent_val) or NOOP

View File

@ -4,13 +4,14 @@ local unpack
unpack = require("moonscript.util").unpack unpack = require("moonscript.util").unpack
local LocalName local LocalName
do do
local _class_0
local _base_0 = { local _base_0 = {
get_name = function(self) get_name = function(self)
return self.name return self.name
end end
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
local _class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, name) __init = function(self, name)
self.name = name self.name = name
self[1] = "temp_name" self[1] = "temp_name"
@ -30,6 +31,7 @@ do
end end
local NameProxy local NameProxy
do do
local _class_0
local _base_0 = { local _base_0 = {
get_name = function(self, scope, dont_put) get_name = function(self, scope, dont_put)
if dont_put == nil then if dont_put == nil then
@ -81,7 +83,7 @@ do
end end
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
local _class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, prefix) __init = function(self, prefix)
self.prefix = prefix self.prefix = prefix
self[1] = "temp_name" self[1] = "temp_name"

View File

@ -5,13 +5,14 @@ do
end end
local Run local Run
do do
local _class_0
local _base_0 = { local _base_0 = {
call = function(self, state) call = function(self, state)
return self.fn(state) return self.fn(state)
end end
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
local _class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, fn) __init = function(self, fn)
self.fn = fn self.fn = fn
self[1] = "run" self[1] = "run"