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

Function canonicalBlock

src/compute-engine/library/control-structures.ts:210–225  ·  view source on GitHub ↗

* * Canonicalize a Block expression * * - Hoist any `Declare` expression to the top of the block * - Add a `Declare` expression for any `Assign` expression * - Error for any `Declare` expression that's an argument to a function *

(
  ops: ReadonlyArray<Expression>,
  options: { engine: ComputeEngine; scope: Scope | undefined }
)

Source from the content-addressed store, hash-verified

208import { isTransitivelyPure } from '../boxed-expression/transitive-purity.js';
209import {
210 evaluateChainForCondition,
211 isNearTiePair,
212} from './relational-operator.js';
213import { isExactConstantExpression } from '../boxed-expression/compare.js';
214import {
215 assignLoopIndex,
216 bindIndexAuthoritatively,
217 substituteBinderValues,
218} from './utils.js';
219import {
220 markDeclaredLocal,
221 markSingleFunctionLocal,
222} from '../boxed-expression/declared-local.js';
223import {
224 isImportView,
225 removeImportView,
226 settleImportViews,
227} from '../import-views.js';
228

Callers

nothing calls this directly

Calls 3

_fnMethod · 0.65
_inScopeMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected