MCPcopy Create free account
hub / github.com/opral/inlang / functionAnnotation

Function functionAnnotation

packages/plugins/icu1/src/parse.ts:489–506  ·  view source on GitHub ↗
(
  name: string,
  param?: TokenList,
)

Source from the content-addressed store, hash-verified

487}
488
489function functionAnnotation(
490 name: string,
491 param?: TokenList,
492): Expression["annotation"] {
493 const options: FunctionReference["options"] = [];
494 const style = param
495 ? serializeTokens(param, { inPlural: false }).trim()
496 : undefined;
497 if (style && style.length > 0) {
498 options.push({ name: "style", value: { type: "literal", value: style } });
499 }
500
501 return {
502 type: "function-reference",
503 name,
504 options,
505 };
506}
507
508function serializeTokens(
509 tokens: TokenList,

Callers 1

expandTokensFunction · 0.85

Calls 1

serializeTokensFunction · 0.85

Tested by

no test coverage detected