Skip to content

Conversation

S-H-GAMELINKS
Copy link
Contributor

Add keyword_defined locations to struct RNode_DEFINED.

This implementation references other add keyword locations pull requests and Prism AST information.
Please let me know if any additional changes are required.

Add keyword_defined locations to struct RNode_DEFINED
@ydah
Copy link
Member

ydah commented Jul 24, 2025

memo:

❯ ruby --dump=parsetree -e 'defined? :a'
@ ProgramNode (location: (1,0)-(1,11))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,11))
    +-- body: (length: 1)
        +-- @ DefinedNode (location: (1,0)-(1,11))
            +-- lparen_loc: nil
            +-- value:
            |   @ SymbolNode (location: (1,9)-(1,11))
            |   +-- SymbolFlags: forced_us_ascii_encoding
            |   +-- opening_loc: (1,9)-(1,10) = ":"
            |   +-- value_loc: (1,10)-(1,11) = "a"
            |   +-- closing_loc: nil
            |   +-- unescaped: "a"
            +-- rparen_loc: nil
            +-- keyword_loc: (1,0)-(1,8) = "defined?"

@ydah ydah merged commit fd492a4 into ruby:master Jul 24, 2025
85 checks passed
@S-H-GAMELINKS S-H-GAMELINKS deleted the add/keyword-defined-locations branch July 24, 2025 15:05
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.

2 participants