MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / lookup

Function lookup

src/compute-engine/function-utils.ts:703–716  ·  view source on GitHub ↗
(
  id: MathJsonSymbol,
  scope: Scope
)

Source from the content-addressed store, hash-verified

701 * spellings apart;
702 * - a string, and any operand that is not `Function`-headed (the shorthand
703 * `_ > 5` lifts to a literal only later);
704 * - an operand that is already CANONICAL — its raw structure is gone;
705 * - a literal with no explicit parameter list, and any parameter that is
706 * already annotated (an author's annotation is never overwritten). The
707 * exception is an annotation `unknown`, or a transparent alias of it: it
708 * is read as a bare parameter (`isUnknownTypedParameter()`), so the slot
709 * type replaces it.
710 */
711export function annotateFunctionLiteralParams(
712 ce: ComputeEngine,
713 op: ExpressionInput,
714 paramTypes: ReadonlyArray<Type | undefined>
715): Expression | undefined {
716 const raw = ce.expr(op, { form: 'raw' });
717 if (raw.isCanonical) return undefined;
718 if (!isFunction(raw, 'Function')) return undefined;
719

Callers 4

lookupDefinitionFunction · 0.90
getSymbolValueFunction · 0.90
setSymbolValueFunction · 0.90
bindMethod · 0.90

Calls 2

assertMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected