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

Function latex

test/utils.ts:243–257  ·  view source on GitHub ↗
(expr: Expression | undefined | null)

Source from the content-addressed store, hash-verified

241 if (expr === undefined) return 'UNDEFINED';
242 if (expr === null) return 'NULL';
243
244 errors = [];
245 let result = '';
246 try {
247 result = engine.expr(expr)?.latex ?? 'NULL';
248 } catch (e) {
249 errors.push(e.toString());
250 }
251 if (result && errors.length !== 0) return result + '\n' + errors.join('\n');
252 if (errors.length !== 0) return errors.join('\n');
253 return result;
254}
255
256export function expressionError(latex: string): string | string[] {
257 errors = [];
258 engine.parse(latex);
259 return errors.length === 1 ? errors[0] : errors;
260}

Callers 13

patterns.test.tsFile · 0.90
symbols.test.tsFile · 0.90
serialize.test.tsFile · 0.90
operators.test.tsFile · 0.90
sets.test.tsFile · 0.90
style.test.tsFile · 0.90
matchfix.test.tsFile · 0.90
arithmetic.test.tsFile · 0.90

Calls 2

exprMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected