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

Function parseModifiers

src/compute-engine/latex-syntax/serializer.ts:528–555  ·  view source on GitHub ↗

Extract the body of the symbol, and the modifiers * (accents and styles)

(
  s: string
)

Source from the content-addressed store, hash-verified

526 logicStyle(
527 expr: MathJsonExpression,
528 level: number
529 ): 'word' | 'boolean' | 'uppercase-word' | 'punctuation' {
530 return this.options.logicStyle(expr, level);
531 }
532
533 powerStyle(
534 expr: MathJsonExpression,
535 level: number
536 ): 'root' | 'solidus' | 'quotient' {
537 return this.options.powerStyle(expr, level);
538 }
539
540 numericSetStyle(
541 expr: MathJsonExpression,
542 level: number
543 ): 'compact' | 'regular' | 'interval' | 'set-builder' {
544 return this.options.numericSetStyle(expr, level);
545 }
546
547 indexStyle(expr: MathJsonExpression, level: number): 'subscript' | 'bracket' {
548 return this.options.indexStyle(expr, level);
549 }
550}
551
552export function appendLatex(src: string, s: string): string {
553 if (!s) return src;
554
555 // If the source end in a LaTeX command,
556 // and the appended string begins with a letter
557 if (/\\[a-zA-Z]+\*?$/.test(src) && /[a-zA-Z]/.test(s[0])) {
558 // Add a space between them

Callers 1

parseSymbolBodyFunction · 0.85

Calls 2

specialNameFunction · 0.85
matchMethod · 0.65

Tested by

no test coverage detected