@@ -536,20 +536,36 @@ Statement = Transformer({
536536 })
537537 end ,
538538 class = function (self , node )
539- local _ , name , parent_val , tbl = unpack (node )
539+ local _ , name , parent_val , body = unpack (node )
540+ local statements = { }
541+ local properties = { }
542+ local _list_0 = body
543+ for _index_0 = 1 , # _list_0 do
544+ local item = _list_0 [_index_0 ]
545+ local _exp_0 = item [1 ]
546+ if " stm" == _exp_0 then
547+ insert (statements , item [2 ])
548+ elseif " props" == _exp_0 then
549+ local _list_1 = item
550+ for _index_0 = 2 , # _list_1 do
551+ local tuple = _list_1 [_index_0 ]
552+ insert (properties , tuple )
553+ end
554+ end
555+ end
540556 local constructor = nil
541- local properties = (function ()
557+ properties = (function ()
542558 local _accum_0 = { }
543559 local _len_0 = 0
544- local _list_0 = tbl [ 2 ]
545- for _index_0 = 1 , # _list_0 do
546- local entry = _list_0 [_index_0 ]
560+ local _list_1 = properties
561+ for _index_0 = 1 , # _list_1 do
562+ local tuple = _list_1 [_index_0 ]
547563 local _value_0
548- if entry [1 ] == constructor_name then
549- constructor = entry [2 ]
564+ if tuple [1 ] == constructor_name then
565+ constructor = tuple [2 ]
550566 _value_0 = nil
551567 else
552- _value_0 = entry
568+ _value_0 = tuple
553569 end
554570 if _value_0 ~= nil then
555571 _len_0 = _len_0 + 1
@@ -558,7 +574,6 @@ Statement = Transformer({
558574 end
559575 return _accum_0
560576 end )()
561- tbl [2 ] = properties
562577 local parent_cls_name = NameProxy (" parent" )
563578 local base_name = NameProxy (" base" )
564579 local self_name = NameProxy (" self" )
@@ -660,9 +675,9 @@ Statement = Transformer({
660675 local slice = (function ()
661676 local _accum_0 = { }
662677 local _len_0 = 0
663- local _list_0 = chain
664- for _index_0 = 3 , # _list_0 do
665- local item = _list_0 [_index_0 ]
678+ local _list_1 = chain
679+ for _index_0 = 3 , # _list_1 do
680+ local item = _list_1 [_index_0 ]
666681 _len_0 = _len_0 + 1
667682 _accum_0 [_len_0 ] = item
668683 end
@@ -710,9 +725,9 @@ Statement = Transformer({
710725 }
711726 }
712727 end
713- local _list_0 = slice
714- for _index_0 = 1 , # _list_0 do
715- local item = _list_0 [_index_0 ]
728+ local _list_1 = slice
729+ for _index_0 = 1 , # _list_1 do
730+ local item = _list_1 [_index_0 ]
716731 insert (new_chain , item )
717732 end
718733 return new_chain
@@ -722,7 +737,10 @@ Statement = Transformer({
722737 end )
723738 end ),
724739 _with_0 .assign_one (parent_cls_name , parent_val == " " and " nil" or parent_val ),
725- _with_0 .assign_one (base_name , tbl ),
740+ _with_0 .assign_one (base_name , {
741+ " table" ,
742+ properties
743+ }),
726744 _with_0 .assign_one (base_name :chain (" __index" ), base_name ),
727745 build [" if" ]({
728746 cond = parent_cls_name ,
0 commit comments