File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -867,17 +867,23 @@ export class LuaPrinter {
867867 protected printExpressionList ( expressions : lua . Expression [ ] ) : SourceChunk [ ] {
868868 const chunks : SourceChunk [ ] = [ ] ;
869869
870- if ( this . isSimpleExpressionList ( expressions ) ) {
871- chunks . push ( ...this . joinChunksWithComma ( expressions . map ( e => this . printExpression ( e ) ) ) ) ;
872- } else {
873- chunks . push ( "\n" ) ;
874- this . pushIndent ( ) ;
875- for ( const [ index , expression ] of expressions . entries ( ) ) {
870+ for ( const [ index , expression ] of expressions . entries ( ) ) {
871+ if ( lua . isCallExpression ( expression ) ) {
872+ if ( index === 0 ) {
873+ chunks . push ( "\n" ) ;
874+ } else {
875+ chunks . pop ( ) ;
876+ chunks . push ( ",\n" ) ;
877+ }
878+ this . pushIndent ( ) ;
876879 const tail = index < expressions . length - 1 ? ",\n" : "\n" ;
877880 chunks . push ( this . indent ( ) , this . printExpression ( expression ) , tail ) ;
881+ this . popIndent ( ) ;
882+ chunks . push ( this . indent ( ) ) ;
883+ } else {
884+ const tail = index < expressions . length - 1 ? ", " : "" ;
885+ chunks . push ( this . printExpression ( expression ) , tail ) ;
878886 }
879- this . popIndent ( ) ;
880- chunks . push ( this . indent ( ) ) ;
881887 }
882888
883889 return chunks ;
You can’t perform that action at this time.
0 commit comments