Skip to content

Commit c421798

Browse files
committed
rebuild
1 parent ff5317e commit c421798

File tree

6 files changed

+32
-74
lines changed

6 files changed

+32
-74
lines changed

moonscript/compile.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,8 @@ do
375375
break
376376
end
377377
local _value_0 = real_name
378-
if _value_0 ~= nil then
379-
_accum_0[_len_0] = _value_0
380-
_len_0 = _len_0 + 1
381-
end
378+
_accum_0[_len_0] = _value_0
379+
_len_0 = _len_0 + 1
382380
_continue_0 = true
383381
until true
384382
if not _continue_0 then

moonscript/compile/value.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,8 @@ local value_compilers = {
135135
insert(default_args, arg)
136136
end
137137
local _value_0 = name
138-
if _value_0 ~= nil then
139-
_accum_0[_len_0] = _value_0
140-
_len_0 = _len_0 + 1
141-
end
138+
_accum_0[_len_0] = _value_0
139+
_len_0 = _len_0 + 1
142140
end
143141
return _accum_0
144142
end)()

moonscript/transform.lua

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,12 @@ apply_to_last = function(stms, fn)
6666
local _accum_0 = { }
6767
local _len_0 = 1
6868
for i, stm in ipairs(stms) do
69-
local _value_0
7069
if i == last_exp_id then
71-
_value_0 = fn(stm)
70+
_accum_0[_len_0] = fn(stm)
7271
else
73-
_value_0 = stm
74-
end
75-
if _value_0 ~= nil then
76-
_accum_0[_len_0] = _value_0
77-
_len_0 = _len_0 + 1
72+
_accum_0[_len_0] = stm
7873
end
74+
_len_0 = _len_0 + 1
7975
end
8076
return _accum_0
8177
end)()
@@ -444,19 +440,15 @@ local Statement = Transformer({
444440
local _list_0 = names
445441
for _index_0 = 1, #_list_0 do
446442
local name = _list_0[_index_0]
447-
local _value_0
448443
if type(name) == "table" then
449-
_value_0 = name
444+
_accum_0[_len_0] = name
450445
else
451-
_value_0 = {
446+
_accum_0[_len_0] = {
452447
"dot",
453448
name
454449
}
455450
end
456-
if _value_0 ~= nil then
457-
_accum_0[_len_0] = _value_0
458-
_len_0 = _len_0 + 1
459-
end
451+
_len_0 = _len_0 + 1
460452
end
461453
return _accum_0
462454
end)()
@@ -466,11 +458,8 @@ local Statement = Transformer({
466458
local _list_0 = names
467459
for _index_0 = 1, #_list_0 do
468460
local name = _list_0[_index_0]
469-
local _value_0 = type(name) == "table" and name[2] or name
470-
if _value_0 ~= nil then
471-
_accum_0[_len_0] = _value_0
472-
_len_0 = _len_0 + 1
473-
end
461+
_accum_0[_len_0] = type(name) == "table" and name[2] or name
462+
_len_0 = _len_0 + 1
474463
end
475464
return _accum_0
476465
end)()
@@ -692,21 +681,17 @@ local Statement = Transformer({
692681
local _accum_0 = { }
693682
local _len_0 = 1
694683
for i, name in ipairs(node.names) do
695-
local _value_0
696684
if ntype(name) == "table" then
697685
do
698686
local _with_0 = NameProxy("des")
699687
local proxy = _with_0
700688
insert(destructures, destructure.build_assign(name, proxy))
701-
_value_0 = _with_0
689+
_accum_0[_len_0] = _with_0
702690
end
703691
else
704-
_value_0 = name
705-
end
706-
if _value_0 ~= nil then
707-
_accum_0[_len_0] = _value_0
708-
_len_0 = _len_0 + 1
692+
_accum_0[_len_0] = name
709693
end
694+
_len_0 = _len_0 + 1
710695
end
711696
return _accum_0
712697
end)()
@@ -887,10 +872,8 @@ local Statement = Transformer({
887872
else
888873
_value_0 = tuple
889874
end
890-
if _value_0 ~= nil then
891-
_accum_0[_len_0] = _value_0
892-
_len_0 = _len_0 + 1
893-
end
875+
_accum_0[_len_0] = _value_0
876+
_len_0 = _len_0 + 1
894877
_continue_0 = true
895878
until true
896879
if not _continue_0 then

moonscript/transform/destructure.lua

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -166,23 +166,17 @@ split_assign = function(assign)
166166
local _accum_0 = { }
167167
local _len_0 = 1
168168
for i = start, stop do
169-
local _value_0 = names[i]
170-
if _value_0 ~= nil then
171-
_accum_0[_len_0] = _value_0
172-
_len_0 = _len_0 + 1
173-
end
169+
_accum_0[_len_0] = names[i]
170+
_len_0 = _len_0 + 1
174171
end
175172
return _accum_0
176173
end)(),
177174
(function()
178175
local _accum_0 = { }
179176
local _len_0 = 1
180177
for i = start, stop do
181-
local _value_0 = values[i]
182-
if _value_0 ~= nil then
183-
_accum_0[_len_0] = _value_0
184-
_len_0 = _len_0 + 1
185-
end
178+
_accum_0[_len_0] = values[i]
179+
_len_0 = _len_0 + 1
186180
end
187181
return _accum_0
188182
end)()
@@ -203,11 +197,8 @@ split_assign = function(assign)
203197
local _accum_0 = { }
204198
local _len_0 = 1
205199
for i = start, total_names do
206-
local _value_0 = names[i]
207-
if _value_0 ~= nil then
208-
_accum_0[_len_0] = _value_0
209-
_len_0 = _len_0 + 1
210-
end
200+
_accum_0[_len_0] = names[i]
201+
_len_0 = _len_0 + 1
211202
end
212203
return _accum_0
213204
end)()
@@ -222,11 +213,8 @@ split_assign = function(assign)
222213
local _accum_0 = { }
223214
local _len_0 = 1
224215
for i = start, total_values do
225-
local _value_0 = values[i]
226-
if _value_0 ~= nil then
227-
_accum_0[_len_0] = _value_0
228-
_len_0 = _len_0 + 1
229-
end
216+
_accum_0[_len_0] = values[i]
217+
_len_0 = _len_0 + 1
230218
end
231219
return _accum_0
232220
end)()

moonscript/transform/names.lua

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,15 @@ do
7171
}
7272
for _index_0 = 1, #_list_0 do
7373
local i = _list_0[_index_0]
74-
local _value_0
7574
if type(i) == "string" then
76-
_value_0 = {
75+
_accum_0[_len_0] = {
7776
"dot",
7877
i
7978
}
8079
else
81-
_value_0 = i
82-
end
83-
if _value_0 ~= nil then
84-
_accum_0[_len_0] = _value_0
85-
_len_0 = _len_0 + 1
80+
_accum_0[_len_0] = i
8681
end
82+
_len_0 = _len_0 + 1
8783
end
8884
return _accum_0
8985
end)(...)

moonscript/util.lua

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,8 @@ dump = function(what)
104104
local _accum_0 = { }
105105
local _len_0 = 1
106106
for k, v in pairs(what) do
107-
local _value_0 = (" "):rep(depth * 4) .. "[" .. tostring(k) .. "] = " .. _dump(v, depth)
108-
if _value_0 ~= nil then
109-
_accum_0[_len_0] = _value_0
110-
_len_0 = _len_0 + 1
111-
end
107+
_accum_0[_len_0] = (" "):rep(depth * 4) .. "[" .. tostring(k) .. "] = " .. _dump(v, depth)
108+
_len_0 = _len_0 + 1
112109
end
113110
return _accum_0
114111
end)()
@@ -148,10 +145,8 @@ debug_posmap = function(posmap, moon_code, lua_code)
148145
local lua_text = get_line(lua_code, lua_line)
149146
local moon_text = get_closest_line(moon_code, moon_line)
150147
local _value_0 = tostring(pos) .. "\t " .. tostring(lua_line) .. ":[ " .. tostring(trim(lua_text)) .. " ] >> " .. tostring(moon_line) .. ":[ " .. tostring(trim(moon_text)) .. " ]"
151-
if _value_0 ~= nil then
152-
_accum_0[_len_0] = _value_0
153-
_len_0 = _len_0 + 1
154-
end
148+
_accum_0[_len_0] = _value_0
149+
_len_0 = _len_0 + 1
155150
end
156151
return _accum_0
157152
end)()

0 commit comments

Comments
 (0)