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

Function pushSafeScope

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

* Push a clean scope - safe for the boxing of rules - that only inherits from the system scope * (index 0), not from the global scope or user-defined scopes. This prevents user-defined symbols * (like `x` used as a function name in `x(y+z)`) from interfering with rule parsing. The system * scope

(ce: ComputeEngine)

Source from the content-addressed store, hash-verified

887 onMatch: onMatch as BoxedRule['onMatch'],
888 onBeforeMatch: onBeforeMatch as BoxedRule['onBeforeMatch'],
889 };
890}
891
892/**
893 * Push a clean scope - safe for the boxing of rules - that only inherits from the system scope
894 * (index 0), not from the global scope or user-defined scopes. This prevents user-defined symbols
895 * (like `x` used as a function name in `x(y+z)`) from interfering with rule parsing. The system
896 * scope contains all built-in definitions.
897 *
898 * This also crucially prevents wildcards from being given definitions where captured & bound.
899 *

Callers 1

boxRuleFunction · 0.85

Calls 1

pushScopeMethod · 0.65

Tested by

no test coverage detected