Start implementing editor popup

This commit is contained in:
2022-04-09 15:27:37 -05:00
parent cab432fe29
commit b47159c4c9
4 changed files with 87 additions and 8 deletions

View File

@@ -300,6 +300,16 @@ export class MathStatement {
return node
}
/** Returns true if the expression is valid. */
isValid(): boolean {
try {
this.toHTMLString()
return true
} catch (_) {
return false
}
}
/** Get all symbols referenced in this statement. */
symbols(): math.SymbolNode[] {
return (new SymbolWalk()).walk(this.parse())