Skip to content

Move liftTopLevel() logic into Prism translator#829

Closed
amomchilov wants to merge 5 commits intomasterfrom
Alex/wrap-program-node
Closed

Move liftTopLevel() logic into Prism translator#829
amomchilov wants to merge 5 commits intomasterfrom
Alex/wrap-program-node

Conversation

@amomchilov
Copy link

@amomchilov amomchilov commented Dec 19, 2025

Motivation

This doesn't need to be a post-processing step. Instead, it's just how the root PM_PROGRAM_NODE should be desugared in the first place.

Test plan

Pure refactor, covered by existing desugar tests.

Copy link
Author

amomchilov commented Dec 19, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@amomchilov amomchilov changed the title Inline node2TreeImplBody() Gut out remaining PrismDesugar.cc logic Dec 19, 2025
if (programNode->statements->body.size == 1) {
auto statement = desugar(programNode->statements->body.nodes[0]);

// If the one statement desugars into an instruction sequence of multiple statements,
Copy link
Author

@amomchilov amomchilov Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amomchilov amomchilov force-pushed the Alex/wrap-program-node branch from dd7fe48 to 7b9d9d9 Compare February 7, 2026 18:46
@amomchilov amomchilov changed the base branch from rm-legacy-parser to master February 7, 2026 18:47
@amomchilov amomchilov changed the title Gut out remaining PrismDesugar.cc logic Move liftTopLevelI() logic into Prism translator Feb 7, 2026
@amomchilov amomchilov changed the title Move liftTopLevelI() logic into Prism translator Move liftTopLevel() logic into Prism translator Feb 9, 2026
@amomchilov amomchilov force-pushed the Alex/wrap-program-node branch from 7b9d9d9 to a4b87e0 Compare February 9, 2026 14:45
@amomchilov
Copy link
Author

amomchilov commented Feb 9, 2026

Upstreaming in sorbet#9889

@amomchilov amomchilov closed this Feb 9, 2026
@amomchilov amomchilov deleted the Alex/wrap-program-node branch February 9, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant