(statement: lua.ForStatement)
| 514 | } |
| 515 | |
| 516 | public printForStatement(statement: lua.ForStatement): SourceNode { |
| 517 | const ctrlVar = this.printExpression(statement.controlVariable); |
| 518 | const ctrlVarInit = this.printExpression(statement.controlVariableInitializer); |
| 519 | const limit = this.printExpression(statement.limitExpression); |
| 520 | |
| 521 | const chunks: SourceChunk[] = []; |
| 522 | |
| 523 | chunks.push(this.indent("for "), ctrlVar, " = ", ctrlVarInit, ", ", limit); |
| 524 | |
| 525 | if (statement.stepExpression) { |
| 526 | chunks.push(", ", this.printExpression(statement.stepExpression)); |
| 527 | } |
| 528 | chunks.push(" do\n"); |
| 529 | |
| 530 | this.pushIndent(); |
| 531 | chunks.push(this.printBlock(statement.body)); |
| 532 | this.popIndent(); |
| 533 | |
| 534 | chunks.push(this.indent("end")); |
| 535 | |
| 536 | return this.concatNodes(...chunks); |
| 537 | } |
| 538 | |
| 539 | public printForInStatement(statement: lua.ForInStatement): SourceNode { |
| 540 | const names = this.joinChunksWithComma(statement.names.map(i => this.printIdentifier(i))); |
no test coverage detected