Include the trailing ? in a keyword key's symbol location - #3043
Merged
Conversation
`parse_keyword_key` handles keys like `foo?:`, where the `?` is part of the method-name-ish key: it interns `foo?` as the constant, but built the symbol node's location from `current_token` alone, so the location covered `foo` and stopped short of the `?`. Extend the range to the end of the `?` token so the location matches the name it is the location of. This is not observable from Ruby -- `rbs_ast_symbol_t` is translated with `ID2SYM` and the wasm serializer writes only the `constant_id`, both of which drop the location. It matters for consumers that read the C AST directly, such as the Rust crate's owned AST. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
soutaro
enabled auto-merge
July 29, 2026 08:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
parse_keyword_keyinternsfoo?as the key offoo?: Integer, but built the symbol's location from the name token alone, so the range stopped one character short of the name it belongs to. This extends it over the?.🤖 Generated with Claude Code