MCPcopy Index your code
hub / github.com/TypeScriptToLua/TypeScriptToLua / printForInStatement

Method printForInStatement

src/LuaPrinter.ts:539–553  ·  view source on GitHub ↗
(statement: lua.ForInStatement)

Source from the content-addressed store, hash-verified

537 }
538
539 public printForInStatement(statement: lua.ForInStatement): SourceNode {
540 const names = this.joinChunksWithComma(statement.names.map(i => this.printIdentifier(i)));
541 const expressions = this.joinChunksWithComma(statement.expressions.map(e => this.printExpression(e)));
542
543 const chunks: SourceChunk[] = [];
544
545 chunks.push(this.indent("for "), ...names, " in ", ...expressions, " do\n");
546
547 this.pushIndent();
548 chunks.push(this.printBlock(statement.body));
549 this.popIndent();
550 chunks.push(this.indent("end"));
551
552 return this.createSourceNode(statement, chunks);
553 }
554
555 public printGotoStatement(statement: lua.GotoStatement): SourceNode {
556 return this.createSourceNode(statement, [this.indent("goto "), statement.label]);

Callers 1

Calls 8

joinChunksWithCommaMethod · 0.95
printIdentifierMethod · 0.95
printExpressionMethod · 0.95
indentMethod · 0.95
pushIndentMethod · 0.95
printBlockMethod · 0.95
popIndentMethod · 0.95
createSourceNodeMethod · 0.95

Tested by

no test coverage detected