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

Function containsError

src/compute-engine/latex-syntax/parse.ts:3198–3204  ·  view source on GitHub ↗

Return true if `expr` is, or contains anywhere, an `Error` node.

(expr: MathJsonExpression | null | undefined)

Source from the content-addressed store, hash-verified

3196 // silently corrupting the value. Surface an error instead; the
3197 // intended nesting is written explicitly as `x^{2^3}`.
3198 if (nonEmptySuperscripts.length > 1)
3199 return this.error('unexpected-superscript', index);
3200 if (nonEmptySuperscripts.length !== 0) {
3201 const superscriptExpression: MathJsonExpression =
3202 nonEmptySuperscripts[0];
3203 const arg: MathJsonExpression = [
3204 'Superscript',
3205 result!,
3206 superscriptExpression,
3207 ];

Callers 1

parseFunction · 0.70

Calls 2

operatorFunction · 0.90
operandsFunction · 0.90

Tested by

no test coverage detected