@@ -664,26 +664,27 @@ export class LuaPrinter {
664664 public printFunctionExpression ( expression : lua . FunctionExpression ) : SourceNode {
665665 const chunks : SourceChunk [ ] = [ ] ;
666666
667+ chunks . push ( "\n" ) ;
667668 chunks . push ( "function(" ) ;
668669 chunks . push ( ...this . printFunctionParameters ( expression ) ) ;
669670 chunks . push ( ")" ) ;
670671
671- if ( lua . isInlineFunctionExpression ( expression ) ) {
672- const returnStatement = expression . body . statements [ 0 ] ;
673- chunks . push ( " " ) ;
674- const returnNode : SourceChunk [ ] = [
675- "return " ,
676- ...this . joinChunksWithComma ( returnStatement . expressions . map ( e => this . printExpression ( e ) ) ) ,
677- ] ;
678- chunks . push ( this . createSourceNode ( returnStatement , returnNode ) ) ;
679- chunks . push ( this . createSourceNode ( expression , " end" ) ) ;
680- } else {
681- chunks . push ( "\n" ) ;
682- this . pushIndent ( ) ;
683- chunks . push ( this . printBlock ( expression . body ) ) ;
684- this . popIndent ( ) ;
685- chunks . push ( this . indent ( this . createSourceNode ( expression , "end" ) ) ) ;
686- }
672+ // if (lua.isInlineFunctionExpression(expression)) {
673+ // const returnStatement = expression.body.statements[0];
674+ // chunks.push(" ");
675+ // const returnNode: SourceChunk[] = [
676+ // "return ",
677+ // ...this.joinChunksWithComma(returnStatement.expressions.map(e => this.printExpression(e))),
678+ // ];
679+ // chunks.push(this.createSourceNode(returnStatement, returnNode));
680+ // chunks.push(this.createSourceNode(expression, " end"));
681+ // } else {
682+ chunks . push ( "\n" ) ;
683+ this . pushIndent ( ) ;
684+ chunks . push ( this . printBlock ( expression . body ) ) ;
685+ this . popIndent ( ) ;
686+ chunks . push ( this . indent ( this . createSourceNode ( expression , "end" ) ) ) ;
687+ // }
687688
688689 return this . createSourceNode ( expression , chunks ) ;
689690 }
0 commit comments