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

Function dewildcard

src/compute-engine/boxed-expression/rules.ts:1472–1482  ·  view source on GitHub ↗

* Replace all occurrences of a wildcard in an expression with a the corresponding non-wildcard, e.g. `_x` -> `x`

(expr: Expression)

Source from the content-addressed store, hash-verified

1470 * For each rule in the rule set that matches, return the full `RuleStep`
1471 * (replacement value with its provenance: the rule id in `because`, plus
1472 * `purpose`). Used by callers that keep a step trace (`explain`).
1473 *
1474 * @param rules
1475 */
1476export function matchAnyRulesWithSteps(
1477 expr: Expression,
1478 rules: BoxedRuleSet,
1479 sub: BoxedSubstitution,
1480 options?: Partial<ReplaceOptions>
1481): RuleStep[] {
1482 const results: RuleStep[] = [];
1483
1484 const collect = (rule: BoxedRule): void => {
1485 // Matching a single rule against a large expression (e.g. a

Callers 1

parseRuleFunction · 0.85

Calls 6

isSymbolFunction · 0.90
isFunctionFunction · 0.90
symbolMethod · 0.65
sliceMethod · 0.65
mapMethod · 0.65
functionMethod · 0.65

Tested by

no test coverage detected