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

Method printComment

src/LuaPrinter.ts:359–371  ·  view source on GitHub ↗
(comment: string | string[])

Source from the content-addressed store, hash-verified

357 }
358
359 public printComment(comment: string | string[]): SourceChunk {
360 if (Array.isArray(comment)) {
361 if (comment.length === 0) {
362 return this.indent("--[[]]");
363 } else {
364 const [firstLine, ...restLines] = comment;
365 const commentLines = this.concatNodes(...restLines.map(c => this.concatNodes("\n", this.indent(c))));
366 return this.concatNodes(this.indent("--[["), firstLine, commentLines, "]]");
367 }
368 } else {
369 return this.indent(`--${comment}`);
370 }
371 }
372
373 protected printStatementExcludingComments(statement: lua.Statement): SourceNode {
374 switch (statement.kind) {

Callers 1

printStatementMethod · 0.95

Calls 2

indentMethod · 0.95
concatNodesMethod · 0.95

Tested by

no test coverage detected