Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3857f14
Detecting simple for loops and transpiling to lua numeric for
tomblind Feb 15, 2019
ab0301a
fixed edge case and added tests
tomblind Feb 16, 2019
5737bb4
Merge remote-tracking branch 'origin/master' into smart-for-loop
tomblind Feb 16, 2019
0a65578
fixed translation tests
tomblind Feb 16, 2019
ab33e93
Merge remote-tracking branch 'origin/master' into smart-for-loop
tomblind May 17, 2019
f36f6cf
re-wrote numeric for loop transformation for clarity and better edge-…
tomblind May 17, 2019
5ef68a9
limit set in initializer now directly substitutes it's value as the l…
tomblind May 18, 2019
385369e
handling complex numerical constants
tomblind May 18, 2019
e6a184a
numerical for tests
tomblind May 18, 2019
59cfe86
using ipairs for for...of array
tomblind May 18, 2019
811807c
additional for...of tests
tomblind May 18, 2019
330e5de
Merge remote-tracking branch 'origin/master' into smart-for-loop
tomblind May 18, 2019
8b04092
generalized expressionPlusOne to expressionPlusNumber and fixed order…
tomblind May 19, 2019
5cad583
removed explicit assignment tracking in favor of using existing refer…
tomblind May 19, 2019
aca5eee
Merge remote-tracking branch 'origin/master' into smart-for-loop
tomblind May 19, 2019
17d195c
Merge remote-tracking branch 'origin/master' into smart-for-loop
tomblind May 19, 2019
a421955
Merge branch 'smart-for-loop' of https://github.com/TypeScriptToLua/T…
tomblind May 19, 2019
6557853
reverting a few unnecessary lines
tomblind May 20, 2019
2cfd9f1
Merge branch 'smart-for-loop' of https://github.com/Perryvw/Typescrip…
tomblind May 20, 2019
f53f894
dis-allowing optimization for loops using '<' or '>' that don't have …
tomblind May 22, 2019
43391bd
Merge branch 'master' into smart-for-loop
tomblind May 24, 2019
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
6 changes: 3 additions & 3 deletions src/LuaPrinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,12 @@ export class LuaPrinter {
}

public printForInStatement(statement: tstl.ForInStatement): SourceNode {
const names = statement.names.map(i => this.printIdentifier(i)).join(", ");
const expressions = statement.expressions.map(e => this.printExpression(e)).join(", ");
const names = this.joinChunks(", ", statement.names.map(i => this.printIdentifier(i)));
const expressions = this.joinChunks(", ", statement.expressions.map(e => this.printExpression(e)));

const chunks: SourceChunk[] = [];

chunks.push(this.indent("for "), names, " in ", expressions, " do\n");
chunks.push(this.indent("for "), ...names, " in ", ...expressions, " do\n");

this.pushIndent();
chunks.push(this.printBlock(statement.body));
Expand Down
Loading