Skip to content
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 occasionally send you account related emails.

Already on GitHub? Sign in to your account

all constant nodes should have full_name and full_name_parts methods #2485

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/prism/node_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ def full_name
end
end

class ConstantWriteNode < Node
# Returns the list of parts for the full name of this constant.
# For example: [:Foo]
def full_name_parts
[name]
end

# Returns the full name of this constant. For example: "Foo"
def full_name
name.to_s
end
end

class ConstantPathNode < Node
# An error class raised when dynamic parts are found while computing a
# constant path's full name. For example:
Expand Down
Loading