You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #269 — spec 0009 (specs/0009-unnest-to-let.md). Depends on #271 (engine), #272 (dialog).
Extend /Unnest to handle a formula that is already a =LET(...). Its own PR so it can't destabilise the core non-LET path.
Scope:
Parse the LET via the existing LetParser (shallow — top-level bindings).
Parse the body and each calculation binding's RHS with the new expression parser (Unnest: formula expression parser (AST) #270), exploding their nested step candidates into new steps.
Insert new steps before the binding (or body) that first uses them, preserving existing bindings' names and relative order.
Existing value bindings left untouched (already inputs).
On FormatException from LetParser, refuse with the same error wording ConvertLetToLambdaCommand uses — no dialog.
Fallback: if re-parenting steps across existing bindings proves fiddly, scope v1 to body-only explosion (flag on the parent if so).
Tests
Existing tidy LET -> body + calc-binding RHSs exploded; value bindings preserved
New steps inserted before first use; existing binding order preserved
Malformed LET -> refuse with clear error, no dialog
Part of #269 — spec 0009 (
specs/0009-unnest-to-let.md). Depends on #271 (engine), #272 (dialog).Extend
/Unnestto handle a formula that is already a=LET(...). Its own PR so it can't destabilise the core non-LET path.Scope:
LetParser(shallow — top-level bindings).FormatExceptionfromLetParser, refuse with the same error wordingConvertLetToLambdaCommanduses — no dialog.Fallback: if re-parenting steps across existing bindings proves fiddly, scope v1 to body-only explosion (flag on the parent if so).
Tests
LetParser