The implementation is a recursive-descent parser with the precedence
spelled out in grammar.ts. No regular expression scans the entire
input — each parse function consumes at most one structural element
so the positional information attached to errors stays accurate.
Parse a formula string into an Ast.
The leading
=is optional, so bothparseFormula('=A1+1')andparseFormula('A1+1')succeed and produce equivalent ASTs.