Commit 0b88dde
Include the trailing
`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>? in a keyword key's symbol location1 parent aa48bf2 commit 0b88dde
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
| 408 | + | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
411 | 414 | | |
412 | 415 | | |
413 | | - | |
| 416 | + | |
414 | 417 | | |
415 | 418 | | |
416 | 419 | | |
417 | 420 | | |
418 | 421 | | |
419 | | - | |
| 422 | + | |
420 | 423 | | |
421 | 424 | | |
422 | 425 | | |
| |||
0 commit comments