Skip to content

Conversation

@amomchilov
Copy link

Motivation

Needed for #667 and #730.

The NumParams node location is set to the location of the first use of a numbered parameter within the block (like _1, _2, ...). This behaviour is really hard for me to mimic, so it's easier to first improve it, and match the new behaviour instead.

@amomchilov amomchilov changed the base branch from master to graphite-base/733 October 30, 2025 14:17
@amomchilov amomchilov force-pushed the Alex/improve-numparams-loc branch from 6f583a8 to c1b8035 Compare October 30, 2025 14:17
@amomchilov amomchilov changed the base branch from graphite-base/733 to Alex/print-all-wq-parser-locs October 30, 2025 14:17
Copy link
Author

amomchilov commented Oct 30, 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.

token_t last_token;
// Stores the opening token (`{` or `do`) for the current block being parsed,
// used to set the location of numparams nodes
token_t current_block_opening_token;
Copy link
Author

Choose a reason for hiding this comment

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

@Morriar can you help me come up with a way to avoid needing new context state like this?

@amomchilov amomchilov changed the base branch from Alex/print-all-wq-parser-locs to graphite-base/733 October 30, 2025 20:52
@amomchilov amomchilov force-pushed the Alex/improve-numparams-loc branch from c1b8035 to 0f39686 Compare October 30, 2025 20:52
@amomchilov amomchilov changed the base branch from graphite-base/733 to Alex/improve-numparams-loc-base October 30, 2025 20:52
@amomchilov amomchilov marked this pull request as draft October 30, 2025 20:53
@amomchilov amomchilov force-pushed the Alex/improve-numparams-loc branch from 0f39686 to b0213ed Compare October 30, 2025 20:56
@amomchilov amomchilov force-pushed the Alex/improve-numparams-loc-base branch 2 times, most recently from 2f7bef7 to 1f0b0b9 Compare November 3, 2025 22:32
@amomchilov
Copy link
Author

Upstreamed in sorbet#9539

@amomchilov amomchilov closed this Nov 12, 2025
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