This commit is contained in:
leaf corcoran 2013-06-10 16:20:44 -07:00
parent 56112e074c
commit 1311671cdc
3 changed files with 27 additions and 33 deletions

View File

@ -624,10 +624,9 @@ do
self._state = { } self._state = { }
self._listeners = { } self._listeners = { }
do do
local _with_0 = transform
self.transform = { self.transform = {
value = _with_0.Value:bind(self), value = transform.Value:bind(self),
statement = _with_0.Statement:bind(self) statement = transform.Statement:bind(self)
} }
end end
if self.parent then if self.parent then
@ -776,8 +775,7 @@ tree = function(tree, options)
end end
end end
do do
local _with_0 = require("moonscript.data") local data = require("moonscript.data")
local data = _with_0
for name, cls in pairs({ for name, cls in pairs({
Line = Line, Line = Line,
Lines = Lines, Lines = Lines,

View File

@ -736,10 +736,9 @@ local Statement = Transformer({
for i, name in ipairs(node.names) do for i, name in ipairs(node.names) do
if ntype(name) == "table" then if ntype(name) == "table" then
do do
local _with_0 = NameProxy("des") local proxy = NameProxy("des")
local proxy = _with_0
insert(destructures, destructure.build_assign(self, name, proxy)) insert(destructures, destructure.build_assign(self, name, proxy))
_accum_0[_len_0] = _with_0 _accum_0[_len_0] = proxy
end end
else else
_accum_0[_len_0] = name _accum_0[_len_0] = name
@ -1103,7 +1102,6 @@ local Statement = Transformer({
}) })
local value = nil local value = nil
do do
local _with_0 = build
local out_body = { local out_body = {
Run(function(self) Run(function(self)
if name then if name then
@ -1180,22 +1178,22 @@ local Statement = Transformer({
"declare_glob", "declare_glob",
"*" "*"
}, },
_with_0.assign_one(parent_cls_name, parent_val == "" and "nil" or parent_val), build.assign_one(parent_cls_name, parent_val == "" and "nil" or parent_val),
_with_0.assign_one(base_name, { build.assign_one(base_name, {
"table", "table",
properties properties
}), }),
_with_0.assign_one(base_name:chain("__index"), base_name), build.assign_one(base_name:chain("__index"), base_name),
_with_0["if"]({ build["if"]({
cond = parent_cls_name, cond = parent_cls_name,
["then"] = { ["then"] = {
_with_0.chain({ build.chain({
base = "setmetatable", base = "setmetatable",
{ {
"call", "call",
{ {
base_name, base_name,
_with_0.chain({ build.chain({
base = parent_cls_name, base = parent_cls_name,
{ {
"dot", "dot",
@ -1207,17 +1205,17 @@ local Statement = Transformer({
}) })
} }
}), }),
_with_0.assign_one(cls_name, cls), build.assign_one(cls_name, cls),
_with_0.assign_one(base_name:chain("__class"), cls_name), build.assign_one(base_name:chain("__class"), cls_name),
_with_0.group((function() build.group((function()
if #statements > 0 then if #statements > 0 then
return { return {
_with_0.assign_one(LocalName("self"), cls_name), build.assign_one(LocalName("self"), cls_name),
_with_0.group(statements) build.group(statements)
} }
end end
end)()), end)()),
_with_0["if"]({ build["if"]({
cond = { cond = {
"exp", "exp",
parent_cls_name, parent_cls_name,
@ -1234,10 +1232,10 @@ local Statement = Transformer({
}) })
} }
}), }),
_with_0.group((function() build.group((function()
if name then if name then
return { return {
_with_0.assign_one(name, cls_name) build.assign_one(name, cls_name)
} }
end end
end)()), end)()),
@ -1247,11 +1245,11 @@ local Statement = Transformer({
end end
end)() end)()
} }
value = _with_0.group({ value = build.group({
_with_0.group((function() build.group((function()
if ntype(name) == "value" then if ntype(name) == "value" then
return { return {
_with_0.declare({ build.declare({
names = { names = {
name name
} }
@ -1259,7 +1257,7 @@ local Statement = Transformer({
} }
end end
end)()), end)()),
_with_0["do"](out_body) build["do"](out_body)
}) })
end end
return value return value

View File

@ -22,8 +22,7 @@ end
local join local join
join = function(...) join = function(...)
do do
local _with_0 = { } local out = { }
local out = _with_0
local i = 1 local i = 1
local _list_0 = { local _list_0 = {
... ...
@ -37,7 +36,7 @@ join = function(...)
i = i + 1 i = i + 1
end end
end end
return _with_0 return out
end end
end end
local has_destructure local has_destructure
@ -122,8 +121,7 @@ build_assign = function(scope, destruct_literal, receiver)
obj = receiver obj = receiver
else else
do do
local _with_0 = NameProxy("obj") obj = NameProxy("obj")
obj = _with_0
inner = build["do"]({ inner = build["do"]({
build.assign_one(obj, receiver), build.assign_one(obj, receiver),
{ {
@ -132,7 +130,7 @@ build_assign = function(scope, destruct_literal, receiver)
values values
} }
}) })
obj = _with_0 obj = obj
end end
end end
local _list_0 = extracted_names local _list_0 = extracted_names