Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
"scripts": {
"build": "tsc -p tsconfig.json && npm run build-lualib",
"build-lualib": "ts-node ./build_lualib.ts",
"test": "npm run style-check && tslint -c ./tslint.json src/lualib/*.ts && npm run build-lualib && ts-node ./test/runner.ts",
"coverage": "nyc npm test && nyc report --reporter=text-lcov > coverage.lcov",
"coverage-html": "nyc npm test && nyc report --reporter=html",
"test-threaded": "style-check && npm run build && ts-node ./test/threaded_runner.ts",
"test": "npm run style-check && npm run build-lualib && tsc -p ./test/tsconfig.json && node ./test/runner.js",
"coverage": "nyc --source-map=true npm test && nyc report --reporter=text-lcov > coverage.lcov",
"coverage-html": "nyc --source-map=true npm test && nyc report --reporter=html",
"test-threaded": "npm run style-check && npm run build && node ./test/threaded_runner.js",
"release-patch": "npm version patch",
"release-minor": "npm version minor",
"release-major": "npm version major",
"preversion": "npm run build && npm test",
"postversion": "git push && git push --tags",
"style-check": "tslint -p .",
"style-check": "tslint -p . && tslint -c ./tslint.json src/lualib/*.ts",
"style-fix": "gts fix && tslint -p . --fix"
},
"bin": {
Expand Down
4 changes: 2 additions & 2 deletions src/CompilerOptions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as ts from "typescript";

export interface CompilerOptions extends ts.CompilerOptions {
addHeader?: boolean;
noHeader?: boolean;
luaTarget?: string;
luaLibImport?: string;
}
Expand All @@ -18,4 +18,4 @@ export enum LuaTarget {
Lua52 = "5.2",
Lua53 = "5.3",
LuaJIT = "jit",
}
}
4 changes: 2 additions & 2 deletions src/LuaAST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export function createDoStatement(statements?: Statement[], parent?: Node, tsOri
// `local test1, test2 = 12, 42` or `local test1, test2`
export interface VariableDeclarationStatement extends Statement {
kind: SyntaxKind.VariableDeclarationStatement;
left: IdentifierOrTableIndexExpression[];
left: Identifier[];
right?: Expression[];
}

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

export function createVariableDeclarationStatement(
left: IdentifierOrTableIndexExpression | IdentifierOrTableIndexExpression[],
left: Identifier | Identifier[],
right?: Expression | Expression[],
parent?: Node,
tsOriginal?: ts.Node): VariableDeclarationStatement {
Expand Down
4 changes: 2 additions & 2 deletions src/LuaPrinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class LuaPrinter {
public print(block: tstl.Block, luaLibFeatures?: Set<LuaLibFeature>): string {
let header = "";

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

Expand Down Expand Up @@ -308,7 +308,7 @@ export class LuaPrinter {
paramterArr.push(this.printDotsLiteral(expression.dots));
}

let result = `function (${paramterArr.join(", ")})\n`;
let result = `function(${paramterArr.join(", ")})\n`;
this.pushIndent();
result += this.printBlock(expression.body);
this.popIndent();
Expand Down
Loading