Skip to content

Commit

Permalink
use cls_name for super access, rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Nov 20, 2015
1 parent 40b7ed6 commit 66d80ed
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 17 deletions.
3 changes: 2 additions & 1 deletion moonscript/cmd/coverage.lua
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions moonscript/cmd/lint.lua
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 11 additions & 6 deletions moonscript/compile.lua
Expand Up @@ -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
Expand Down Expand Up @@ -127,7 +128,7 @@ do
end
}
_base_0.__index = _base_0
local _class_0 = setmetatable({
_class_0 = setmetatable({
__init = function(self)
self.posmap = { }
end,
Expand All @@ -145,6 +146,7 @@ do
Lines = _class_0
end
do
local _class_0
local _base_0 = {
pos = nil,
append_list = function(self, items, delim)
Expand Down Expand Up @@ -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"
Expand All @@ -224,6 +226,7 @@ do
Line = _class_0
end
do
local _class_0
local _base_0 = {
prepare = function() end,
render = function(self)
Expand All @@ -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,
Expand All @@ -250,6 +253,7 @@ do
DelayedLine = _class_0
end
do
local _class_0
local _base_0 = {
header = "do",
footer = "end",
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -613,6 +617,7 @@ do
Block = _class_0
end
do
local _class_0
local _parent_0 = Block
local _base_0 = {
__tostring = function(self)
Expand All @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion moonscript/data.lua
Expand Up @@ -14,6 +14,7 @@ Set = function(items)
end
local Stack
do
local _class_0
local _base_0 = {
__tostring = function(self)
return "<Stack {" .. concat(self, ", ") .. "}>"
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions moonscript/transform.moon
Expand Up @@ -680,8 +680,7 @@ Statement = Transformer {
@set "super", (block, chain) ->
relative_parent = {
"chain",
"self"
{"dot", "__class"}
cls_name
{"dot", "__parent"}
}

Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions moonscript/transform/names.lua
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion moonscript/transform/statements.lua
Expand Up @@ -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"
Expand Down

0 comments on commit 66d80ed

Please sign in to comment.