MCPcopy Create free account
hub / github.com/compilets/compilets / print

Method print

src/cpp-syntax.ts:408–417  ·  view source on GitHub ↗
(ctx: PrintContext)

Source from the content-addressed store, hash-verified

406 }
407
408 override print(ctx: PrintContext) {
409 this.type.markUsed(ctx);
410 const returnType = this.returnType.print(ctx);
411 const fullParameters = ParameterDeclaration.printParameters(ctx, this.parameters);
412 const shortParameters = this.parameters.map(p => p.type.print(ctx)).join(', ');
413 const body = this.body?.print(ctx) ?? '{}';
414 const lambda = `[=](${fullParameters}) -> ${returnType} ${body}`;
415 const closure = this.closure.map(c => c.print(ctx));
416 return `compilets::MakeFunction<${returnType}(${shortParameters})>(${[ lambda, ...closure ].join(', ')})`;
417 }
418}
419
420// Represent the arguments of a call-like expression.

Callers

nothing calls this directly

Calls 4

printParametersMethod · 0.80
markUsedMethod · 0.45
printMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected