@@ -376,32 +376,38 @@ construct_comprehension = function(inner, clauses)
376376end
377377Statement = Transformer ({
378378 assign = function (self , node )
379- local _ , names , values = unpack (node )
380- if # values == 1 and types .cascading [ntype (values [1 ])] then
381- values [1 ] = self .transform .statement (values [1 ], function (stm )
382- local t = ntype (stm )
383- if types .is_value (stm ) then
384- return {
385- " assign" ,
386- names ,
387- {
388- stm
389- }
390- }
391- else
392- return stm
393- end
394- end )
395- return build .group ({
396- {
397- " declare" ,
398- names
399- },
400- values [1 ]
401- })
402- else
403- return node
379+ local names , values = unpack (node , 2 )
380+ local transformed
381+ if # values == 1 then
382+ local value = values [1 ]
383+ local t = ntype (value )
384+ if t == " decorated" then
385+ value = self .transform .statement (value )
386+ t = ntype (value )
387+ end
388+ if types .cascading [t ] then
389+ transformed = build .group ({
390+ {
391+ " declare" ,
392+ names
393+ },
394+ self .transform .statement (value , function (stm )
395+ if types .is_value (stm ) then
396+ return {
397+ " assign" ,
398+ names ,
399+ {
400+ stm
401+ }
402+ }
403+ else
404+ return stm
405+ end
406+ end )
407+ })
408+ end
404409 end
410+ return transformed or node
405411 end ,
406412 export = function (self , node )
407413 if # node > 2 then
@@ -1258,6 +1264,9 @@ Value = Transformer({
12581264 [" for" ] = default_accumulator ,
12591265 [" while" ] = default_accumulator ,
12601266 foreach = default_accumulator ,
1267+ decorated = function (self , node )
1268+ return self .transform .statement (node )
1269+ end ,
12611270 string = function (self , node )
12621271 local delim = node [2 ]
12631272 local convert_part
0 commit comments