Formula text as a tree, and back, with no calculation involved.
Remarks
A file format reads and writes formulas as text and needs to see their structure to spell them:
which function a name is, which argument a range sits in, where an operator was implied. This is
the parser and the printer the compiler uses, offered on text alone. Nothing here resolves a
symbol or evaluates anything: a sheet name is text, a function name is text, a cell is an
offset from the anchor.
The parser is loaded on demand. Await load first: until it resolves, parse
answers null and transform returns the tree it was given, which is what each answers
for text it cannot read. A calculation's start loads it too.
Formula text as a tree, and back, with no calculation involved.
Remarks
A file format reads and writes formulas as text and needs to see their structure to spell them: which function a name is, which argument a range sits in, where an operator was implied. This is the parser and the printer the compiler uses, offered on text alone. Nothing here resolves a symbol or evaluates anything: a sheet name is text, a function name is text, a cell is an offset from the anchor.
The parser is loaded on demand. Await load first: until it resolves, parse answers
nulland transform returns the tree it was given, which is what each answers for text it cannot read. A calculation's start loads it too.Example