Variants:
num — numeric literal carrying its parsed value.cell — single A1 reference resolved to a CellRef.range — inclusive rectangular range from from to to.binop — binary arithmetic with operator BinOp and
left/right operands.unary — unary minus applied to operand.call — function invocation by name with positional args.The tag field type is the discriminator. Every variant is a plain
JSON object so the whole tree round-trips through
JSON.stringify / JSON.parse without loss — the property test in
test/ir-roundtrip.test.ts pins that contract.
Discriminated AST union produced by the formula parser.