8000 Implement COLON2 and COLON3 NODE locations by ydah · Pull Request #11987 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

Implement COLON2 and COLON3 NODE locations #11987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasi 8000 onally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 15, 2025
Merged

Conversation

ydah
Copy link
Member
@ydah ydah commented Nov 2, 2024

The following Location information has been added This is the information required for parse.y to be a universal parser:

❯ ruby --parser=prism --dump=parsetree -e "A::B"                      
@ ProgramNode (location: (1,0)-(1,4))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,4))
    +-- body: (length: 1)
        +-- @ ConstantPathNode (location: (1,0)-(1,4))
            +-- parent:
            |   @ ConstantReadNode (location: (1,0)-(1,1))
            |   +-- name: :A
            +-- name: :B
            +-- delimiter_loc: (1,1)-(1,3) = "::"
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            +-- name_loc: (1,3)-(1,4) = "B"
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

❯ ruby --parser=prism --dump=parsetree -e "::A"                       
@ ProgramNode (location: (1,0)-(1,3))
+-- locals: []
+-- statements:
    @ StatementsNode (location: (1,0)-(1,3))
    +-- body: (length: 1)
        +-- @ ConstantPathNode (location: (1,0)-(1,3))
            +-- parent: nil
            +-- name: :A
            +-- delimiter_loc: (1,0)-(1,2) = "::"
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            +-- name_loc: (1,2)-(1,3) = "A"
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@ydah ydah force-pushed the colon-locations branch 3 times, most recently from 275daee to e0cc451 Compare November 8, 2024 07:26
@ydah ydah force-pushed the colon-locations branch from d054d00 to d01c813 Compare January 4, 2025 11:36
@ydah ydah force-pushed the colon-locations branch 2 times, most recently from cf2e66e to f85bd9f Compare March 8, 2025 11:28
@ydah ydah force-pushed the colon-locations branch from f85bd9f to 2d801ad Compare June 15, 2025 12:04
@ydah ydah merged commit d60144a into ruby:master Jun 15, 2025
84 checks passed
@ydah ydah deleted the colon-locations branch June 15, 2025 13:37
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
0