Skip to content

Commit aa4fd66

Browse files
committed
Made typescript lua include optional, ternary operator will not work without it
1 parent 791f136 commit aa4fd66

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

dist/Transpiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var LuaTranspiler = /** @class */ (function () {
3333
// Transpile a source file
3434
LuaTranspiler.transpileSourceFile = function (node, checker) {
3535
var transpiler = new LuaTranspiler(checker);
36-
return "require(\"lib.typescript\")\n" + transpiler.transpileBlock(node);
36+
return transpiler.transpileBlock(node);
3737
};
3838
LuaTranspiler.prototype.pushIndent = function () {
3939
this.indent = this.indent + " ";

dist/typescript.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- Ternary operator
2+
function TS_ITE(condition, v1f, v2f)
3+
if condition then
4+
return v1f()
5+
else
6+
return v2f()
7+
end
8+
end

src/Transpiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class LuaTranspiler {
1515
// Transpile a source file
1616
static transpileSourceFile(node: ts.SourceFile, checker: ts.TypeChecker): string {
1717
let transpiler = new LuaTranspiler(checker);
18-
return "require(\"lib.typescript\")\n" + transpiler.transpileBlock(node);
18+
return transpiler.transpileBlock(node);
1919
}
2020

2121
indent: string;

0 commit comments

Comments
 (0)