@@ -264,9 +264,9 @@ export abstract class LuaTranspiler {
264264 case ts . SyntaxKind . FunctionDeclaration :
265265 return this . transpileFunctionDeclaration ( node as ts . FunctionDeclaration ) ;
266266 case ts . SyntaxKind . VariableStatement :
267- return this . indent + this . transpileVariableStatement ( node as ts . VariableStatement ) + "\n" ;
267+ return this . indent + this . transpileVariableStatement ( node as ts . VariableStatement ) + "; \n" ;
268268 case ts . SyntaxKind . ExpressionStatement :
269- return this . indent + this . transpileExpression ( ( node as ts . ExpressionStatement ) . expression ) + "\n" ;
269+ return this . indent + this . transpileExpression ( ( node as ts . ExpressionStatement ) . expression ) + "; \n" ;
270270 case ts . SyntaxKind . ReturnStatement :
271271 return this . indent + this . transpileReturn ( node as ts . ReturnStatement ) + "\n" ;
272272 case ts . SyntaxKind . IfStatement :
@@ -503,7 +503,7 @@ export abstract class LuaTranspiler {
503503 // Add header
504504 let result = "" ;
505505 for ( const variableDeclaration of ( node . initializer as ts . VariableDeclarationList ) . declarations ) {
506- result += this . indent + this . transpileVariableDeclaration ( variableDeclaration ) ;
506+ result += this . indent + this . transpileVariableDeclaration ( variableDeclaration ) + "\n" ;
507507 }
508508 result += this . indent + `while(${ this . transpileExpression ( node . condition ) } ) do\n` ;
509509
@@ -1433,9 +1433,9 @@ export abstract class LuaTranspiler {
14331433 const identifierName = this . transpileIdentifier ( node . name ) ;
14341434 if ( node . initializer ) {
14351435 const value = this . transpileExpression ( node . initializer ) ;
1436- return `local ${ identifierName } = ${ value } \n ` ;
1436+ return `local ${ identifierName } = ${ value } ` ;
14371437 } else {
1438- return `local ${ identifierName } = nil\n ` ;
1438+ return `local ${ identifierName } = nil` ;
14391439 }
14401440 } else if ( ts . isArrayBindingPattern ( node . name ) ) {
14411441 // Destructuring type
@@ -1449,9 +1449,9 @@ export abstract class LuaTranspiler {
14491449
14501450 // Don't unpack TupleReturn decorated functions
14511451 if ( tsHelper . isTupleReturnCall ( node . initializer , this . checker ) ) {
1452- return `local ${ vars } =${ this . transpileExpression ( node . initializer ) } \n ` ;
1452+ return `local ${ vars } =${ this . transpileExpression ( node . initializer ) } ` ;
14531453 } else {
1454- return `local ${ vars } =${ this . transpileDestructingAssignmentValue ( node . initializer ) } \n ` ;
1454+ return `local ${ vars } =${ this . transpileDestructingAssignmentValue ( node . initializer ) } ` ;
14551455 }
14561456 } else {
14571457 throw TSTLErrors . UnsupportedKind ( "variable declaration" , node . name . kind , node ) ;
0 commit comments