@@ -263,9 +263,9 @@ export abstract class LuaTranspiler {
263263 case ts . SyntaxKind . FunctionDeclaration :
264264 return this . transpileFunctionDeclaration ( node as ts . FunctionDeclaration ) ;
265265 case ts . SyntaxKind . VariableStatement :
266- return this . indent + this . transpileVariableStatement ( node as ts . VariableStatement ) + "\n" ;
266+ return this . indent + this . transpileVariableStatement ( node as ts . VariableStatement ) + "; \n" ;
267267 case ts . SyntaxKind . ExpressionStatement :
268- return this . indent + this . transpileExpression ( ( node as ts . ExpressionStatement ) . expression ) + "\n" ;
268+ return this . indent + this . transpileExpression ( ( node as ts . ExpressionStatement ) . expression ) + "; \n" ;
269269 case ts . SyntaxKind . ReturnStatement :
270270 return this . indent + this . transpileReturn ( node as ts . ReturnStatement ) + "\n" ;
271271 case ts . SyntaxKind . IfStatement :
@@ -491,7 +491,7 @@ export abstract class LuaTranspiler {
491491 // Add header
492492 let result = "" ;
493493 for ( const variableDeclaration of ( node . initializer as ts . VariableDeclarationList ) . declarations ) {
494- result += this . indent + this . transpileVariableDeclaration ( variableDeclaration ) ;
494+ result += this . indent + this . transpileVariableDeclaration ( variableDeclaration ) + "\n" ;
495495 }
496496 result += this . indent + `while(${ this . transpileExpression ( node . condition ) } ) do\n` ;
497497
@@ -1407,9 +1407,9 @@ export abstract class LuaTranspiler {
14071407 const identifierName = this . transpileIdentifier ( node . name ) ;
14081408 if ( node . initializer ) {
14091409 const value = this . transpileExpression ( node . initializer ) ;
1410- return `local ${ identifierName } = ${ value } \n ` ;
1410+ return `local ${ identifierName } = ${ value } ` ;
14111411 } else {
1412- return `local ${ identifierName } = nil\n ` ;
1412+ return `local ${ identifierName } = nil` ;
14131413 }
14141414 } else if ( ts . isArrayBindingPattern ( node . name ) ) {
14151415 // Destructuring type
@@ -1423,9 +1423,9 @@ export abstract class LuaTranspiler {
14231423
14241424 // Don't unpack TupleReturn decorated functions
14251425 if ( tsHelper . isTupleReturnCall ( node . initializer , this . checker ) ) {
1426- return `local ${ vars } =${ this . transpileExpression ( node . initializer ) } \n ` ;
1426+ return `local ${ vars } =${ this . transpileExpression ( node . initializer ) } ` ;
14271427 } else {
1428- return `local ${ vars } =${ this . transpileDestructingAssignmentValue ( node . initializer ) } \n ` ;
1428+ return `local ${ vars } =${ this . transpileDestructingAssignmentValue ( node . initializer ) } ` ;
14291429 }
14301430 } else {
14311431 throw TSTLErrors . UnsupportedKind ( "variable declaration" , node . name . kind , node ) ;
0 commit comments