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

Method printStatement

src/LuaPrinter.ts:337–357  ·  view source on GitHub ↗
(statement: lua.Statement)

Source from the content-addressed store, hash-verified

335 }
336
337 public printStatement(statement: lua.Statement): SourceNode {
338 let resultNode = this.printStatementExcludingComments(statement);
339
340 if (statement.leadingComments) {
341 resultNode = this.concatNodes(
342 statement.leadingComments.map(c => this.printComment(c)).join("\n"),
343 "\n",
344 resultNode
345 );
346 }
347
348 if (statement.trailingComments) {
349 resultNode = this.concatNodes(
350 resultNode,
351 "\n",
352 statement.trailingComments.map(c => this.printComment(c)).join("\n")
353 );
354 }
355
356 return resultNode;
357 }
358
359 public printComment(comment: string | string[]): SourceChunk {
360 if (Array.isArray(comment)) {

Callers 1

printStatementArrayMethod · 0.95

Calls 3

concatNodesMethod · 0.95
printCommentMethod · 0.95

Tested by

no test coverage detected