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

Function tokenizeLaTeX

src/compute-engine/boxed-expression/rules.ts:288–298  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

286 for (const cond of conditions) {
287 // An unknown condition name fails closed rather than crashing: the name
288 // can come from user input (the `Condition` operator's second operand),
289 // and an unguarded lookup threw `CONDITIONS[cond] is not a function` out
290 // of `evaluate()` for e.g. `Condition(x, "fuzz")`.
291 const predicate = CONDITIONS[cond as keyof typeof CONDITIONS];
292 if (predicate === undefined || predicate(x) !== true) return false;
293 }
294 return true;
295}
296
297/**
298 * Evaluate a rule-condition predicate and report whether it discharges.
299 *
300 * Rule guards must be *fail-closed*: an unprovable predicate (e.g. `w ≠ 0` for
301 * an unconstrained `w`) must NOT satisfy the guard. Plain `.evaluate()` applies

Callers 1

parseModifierFunction · 0.85

Calls 1

matchMethod · 0.65

Tested by

no test coverage detected