From 5758e45657f0b2ca8725e67046a1cac92e2e6414 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 3 May 2024 09:35:32 -0400 Subject: [ruby/prism] Change ConstantPathNode#child to ConstantPathNode#{name,name_loc} This has been requested for a long time, and I'm finally doing it now. Unfortunately this is a breaking change for all of the APIs. I've added in a Ruby method for `#child` that is deprecated so that existing usage doesn't break, but for everyone else this is going to be a bit of a pain. https://github.com/ruby/prism/commit/9cbe74464e --- lib/prism/translation/ripper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/prism/translation/ripper.rb') diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index 4e3b1b74fd..5cb6f6715d 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -1456,16 +1456,16 @@ module Prism # ^^^^^^^^ def visit_constant_path_node(node) if node.parent.nil? - bounds(node.child.location) - child = on_const(node.child.name.to_s) + bounds(node.name_loc) + child = on_const(node.name.to_s) bounds(node.location) on_top_const_ref(child) else parent = visit(node.parent) - bounds(node.child.location) - child = on_const(node.child.name.to_s) + bounds(node.name_loc) + child = on_const(node.name.to_s) bounds(node.location) on_const_path_ref(parent, child) -- cgit v1.2.3