* Parse `latex` into a MathJSON expression, marking any leftover tokens with * an `Error` node. This is the core routine, without the trailing-punctuation * recovery or `preserveLatex` post-processing applied by `parse`.
( latex: string, dictionary: IndexedLatexDictionary, options: Readonly<ParseLatexOptions> )
| 3209 | if (typeof def.parse === 'function') |
| 3210 | result = def.parse(this, arg, { minPrec: 0 }); |
| 3211 | else result = arg; |
| 3212 | if (result !== null) break; |
| 3213 | } |
| 3214 | } |
| 3215 | } |
| 3216 | } |
| 3217 | |
| 3218 | // Restore the index if we did not find a match |
| 3219 | if (result === null) this.index = index; |
| 3220 | |
| 3221 | return result; |
| 3222 | } |
| 3223 | |
| 3224 | parsePostfixOperator( |
| 3225 | lhs: MathJsonExpression | null, |
| 3226 | until?: Readonly<Terminator> |
| 3227 | ): MathJsonExpression | null { |
| 3228 | console.assert(lhs !== null); // @todo validate |
| 3229 | if (lhs === null || this.atEnd) return null; |
| 3230 | |
| 3231 | const start = this.index; |
| 3232 | // Skip visual space (e.g. `\ `, `\,`) before peeking postfix triggers, so |
no test coverage detected