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

Function guardJson

src/compute-engine/fungrim/loader.ts:95–101  ·  view source on GitHub ↗

The MathJSON payload(s) of a guard (for symbol/wildcard collection).

(g: GuardSpec)

Source from the content-addressed store, hash-verified

93
94/** The MathJSON payload(s) of a guard (for symbol/wildcard collection). */
95function guardJson(g: GuardSpec): FungrimMathJson {
96 if (g.k === 'type') return g.wc;
97 if (g.k === 'cmp' || g.k === 'part-cmp') return [g.wc, g.bound];
98 if (g.k === 'member') return [g.wc, g.set];
99 if (g.k === 'ne') return [g.lhs, g.rhs];
100 return g.pred;
101}
102
103/** GuardSpec part tags → CE operator heads. */
104const PART_TO_OPERATOR: Record<'re' | 'im' | 'abs' | 'arg', string> = {

Callers 2

boxCompiledRuleFunction · 0.85
collectReferencedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected