File tree Expand file tree Collapse file tree 7 files changed +58
-40
lines changed
Expand file tree Collapse file tree 7 files changed +58
-40
lines changed Original file line number Diff line number Diff line change @@ -11,5 +11,9 @@ global:
1111compile :
1212 bin/moonc moon/ moonscript/
1313
14+
15+ compile_global :
16+ moonc moon/ moonscript/
17+
1418watch :
1519 moonc -w moon/ moonscript/
Original file line number Diff line number Diff line change 356356 local _len_0 = 1
357357 local _list_0 = names
358358 for _index_0 = 1 , # _list_0 do
359- local name = _list_0 [_index_0 ]
360- local is_local = false
361- local real_name
362- local _exp_0 = mtype (name )
363- if LocalName == _exp_0 then
364- is_local = true
365- real_name = name :get_name (self )
366- elseif NameProxy == _exp_0 then
367- real_name = name :get_name (self )
368- elseif " string" == _exp_0 then
369- real_name = name
370- end
371- local _value_0
372- if is_local or real_name and not self :has_name (real_name ) then
373- _value_0 = real_name
374- end
375- if _value_0 ~= nil then
376- _accum_0 [_len_0 ] = _value_0
377- _len_0 = _len_0 + 1
359+ local _continue_0 = false
360+ repeat
361+ local name = _list_0 [_index_0 ]
362+ local is_local = false
363+ local real_name
364+ local _exp_0 = mtype (name )
365+ if LocalName == _exp_0 then
366+ is_local = true
367+ real_name = name :get_name (self )
368+ elseif NameProxy == _exp_0 then
369+ real_name = name :get_name (self )
370+ elseif " string" == _exp_0 then
371+ real_name = name
372+ end
373+ if not (is_local or real_name and not self :has_name (real_name )) then
374+ _continue_0 = true
375+ break
376+ end
377+ 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
382+ _continue_0 = true
383+ until true
384+ if not _continue_0 then
385+ break
378386 end
379387 end
380388 return _accum_0
Original file line number Diff line number Diff line change @@ -216,7 +216,8 @@ class Block
216216 when NameProxy then name\ get_name self
217217 when " string" then name
218218
219- real_name if is_local or real_name and not @has_name real_name
219+ continue unless is_local or real_name and not @has_name real_name
220+ real_name
220221
221222 @put_name name for name in * undeclared
222223 undeclared
Original file line number Diff line number Diff line change @@ -209,11 +209,8 @@ local value_compilers = {
209209 local _list_2 = args
210210 for _index_0 = 1 , # _list_2 do
211211 local arg = _list_2 [_index_0 ]
212- local _value_0 = arg [1 ]
213- if _value_0 ~= nil then
214- _accum_0 [_len_0 ] = _value_0
215- _len_0 = _len_0 + 1
216- end
212+ _accum_0 [_len_0 ] = arg [1 ]
213+ _len_0 = _len_0 + 1
217214 end
218215 return _accum_0
219216 end )()
Original file line number Diff line number Diff line change @@ -112,9 +112,9 @@ value_compilers =
112112 \ stms block
113113
114114 -- inject more args if the block manipulated arguments
115+ -- only varargs bubbling does this currently
115116 if # args > # arg_names -- will only work for simple adjustments
116- arg_names = for arg in * args
117- arg[ 1 ]
117+ arg_names = [ arg[ 1 ] for arg in * args]
118118
119119 . header = " function(" .. concat( arg_names, " , " ) .. " )"
120120
Original file line number Diff line number Diff line change @@ -875,18 +875,26 @@ local Statement = Transformer({
875875 local _len_0 = 1
876876 local _list_1 = properties
877877 for _index_0 = 1 , # _list_1 do
878- local tuple = _list_1 [_index_0 ]
879- local key = tuple [1 ]
880- local _value_0
881- if key [1 ] == " key_literal" and key [2 ] == constructor_name then
882- constructor = tuple [2 ]
883- _value_0 = nil
884- else
885- _value_0 = tuple
886- end
887- if _value_0 ~= nil then
888- _accum_0 [_len_0 ] = _value_0
889- _len_0 = _len_0 + 1
878+ local _continue_0 = false
879+ repeat
880+ local tuple = _list_1 [_index_0 ]
881+ local key = tuple [1 ]
882+ local _value_0
883+ if key [1 ] == " key_literal" and key [2 ] == constructor_name then
884+ constructor = tuple [2 ]
885+ _continue_0 = true
886+ break
887+ else
888+ _value_0 = tuple
889+ end
890+ if _value_0 ~= nil then
891+ _accum_0 [_len_0 ] = _value_0
892+ _len_0 = _len_0 + 1
893+ end
894+ _continue_0 = true
895+ until true
896+ if not _continue_0 then
897+ break
890898 end
891899 end
892900 return _accum_0
Original file line number Diff line number Diff line change @@ -486,7 +486,7 @@ Statement = Transformer {
486486 key = tuple[ 1 ]
487487 if key[ 1 ] == " key_literal" and key[ 2 ] == constructor_name
488488 constructor = tuple[ 2 ]
489- nil
489+ continue
490490 else
491491 tuple
492492
You can’t perform that action at this time.
0 commit comments