Skip to content

Commit 826c459

Browse files
authored
Merge pull request #349 from Perryvw/transformer-exports
Transformer exports
2 parents 6ac05e2 + 37d2bd7 commit 826c459

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+414
-297
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
"scripts": {
1515
"build": "tsc -p tsconfig.json && npm run build-lualib",
1616
"build-lualib": "ts-node ./build_lualib.ts",
17-
"test": "npm run style-check && tslint -c ./tslint.json src/lualib/*.ts && npm run build-lualib && ts-node ./test/runner.ts",
18-
"coverage": "nyc npm test && nyc report --reporter=text-lcov > coverage.lcov",
19-
"coverage-html": "nyc npm test && nyc report --reporter=html",
20-
"test-threaded": "style-check && npm run build && ts-node ./test/threaded_runner.ts",
17+
"test": "npm run style-check && npm run build-lualib && tsc -p ./test/tsconfig.json && node ./test/runner.js",
18+
"coverage": "nyc --source-map=true npm test && nyc report --reporter=text-lcov > coverage.lcov",
19+
"coverage-html": "nyc --source-map=true npm test && nyc report --reporter=html",
20+
"test-threaded": "npm run style-check && npm run build && node ./test/threaded_runner.js",
2121
"release-patch": "npm version patch",
2222
"release-minor": "npm version minor",
2323
"release-major": "npm version major",
2424
"preversion": "npm run build && npm test",
2525
"postversion": "git push && git push --tags",
26-
"style-check": "tslint -p .",
26+
"style-check": "tslint -p . && tslint -c ./tslint.json src/lualib/*.ts",
2727
"style-fix": "gts fix && tslint -p . --fix"
2828
},
2929
"bin": {

src/CompilerOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as ts from "typescript";
22

33
export interface CompilerOptions extends ts.CompilerOptions {
4-
addHeader?: boolean;
4+
noHeader?: boolean;
55
luaTarget?: string;
66
luaLibImport?: string;
77
}
@@ -18,4 +18,4 @@ export enum LuaTarget {
1818
Lua52 = "5.2",
1919
Lua53 = "5.3",
2020
LuaJIT = "jit",
21-
}
21+
}

src/LuaAST.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export function createDoStatement(statements?: Statement[], parent?: Node, tsOri
189189
// `local test1, test2 = 12, 42` or `local test1, test2`
190190
export interface VariableDeclarationStatement extends Statement {
191191
kind: SyntaxKind.VariableDeclarationStatement;
192-
left: IdentifierOrTableIndexExpression[];
192+
left: Identifier[];
193193
right?: Expression[];
194194
}
195195

@@ -198,7 +198,7 @@ export function isVariableDeclarationStatement(node: Node): node is VariableDecl
198198
}
199199

200200
export function createVariableDeclarationStatement(
201-
left: IdentifierOrTableIndexExpression | IdentifierOrTableIndexExpression[],
201+
left: Identifier | Identifier[],
202202
right?: Expression | Expression[],
203203
parent?: Node,
204204
tsOriginal?: ts.Node): VariableDeclarationStatement {

src/LuaPrinter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class LuaPrinter {
4848
public print(block: tstl.Block, luaLibFeatures?: Set<LuaLibFeature>): string {
4949
let header = "";
5050

51-
if (this.options.addHeader === undefined || this.options.addHeader === true) {
51+
if (this.options.noHeader === undefined || this.options.noHeader === false) {
5252
header += `--[[ Generated with https://github.com/Perryvw/TypescriptToLua ]]\n`;
5353
}
5454

@@ -308,7 +308,7 @@ export class LuaPrinter {
308308
paramterArr.push(this.printDotsLiteral(expression.dots));
309309
}
310310

311-
let result = `function (${paramterArr.join(", ")})\n`;
311+
let result = `function(${paramterArr.join(", ")})\n`;
312312
this.pushIndent();
313313
result += this.printBlock(expression.body);
314314
this.popIndent();

0 commit comments

Comments
 (0)