summaryrefslogtreecommitdiff
path: root/lib/prism/debug.rb
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-01-25 08:43:41 -0500
committergit <svn-admin@ruby-lang.org>2024-01-25 13:58:07 +0000
commitebf803aa196e2df4c129b1ec11107363ebbe1382 (patch)
treebf0020630ce863480afa5e5b726a7b0109d4b2e1 /lib/prism/debug.rb
parentfdb8f086396e0f9b64e069852cb0dd40147877d1 (diff)
[ruby/prism] Fix Ruby head build
https://github.com/ruby/prism/commit/149e2ff7f6
Diffstat (limited to 'lib/prism/debug.rb')
-rw-r--r--lib/prism/debug.rb18
1 files changed, 2 insertions, 16 deletions
diff --git a/lib/prism/debug.rb b/lib/prism/debug.rb
index 24a27d07ef..f4c0bcf91a 100644
--- a/lib/prism/debug.rb
+++ b/lib/prism/debug.rb
@@ -59,21 +59,7 @@ module Prism
stack = [ISeq.new(RubyVM::InstructionSequence.compile(source).to_a)]
while (iseq = stack.pop)
- names = [*iseq.local_table]
- names.map!.with_index do |name, index|
- # When an anonymous local variable is present in the iseq's local
- # table, it is represented as the stack offset from the top.
- # However, when these are dumped to binary and read back in, they
- # are replaced with the symbol :#arg_rest. To consistently handle
- # this, we replace them here with their index.
- if name == :"#arg_rest"
- names.length - index + 1
- else
- name
- end
- end
-
- locals << names
+ locals << iseq.local_table
iseq.each_child { |child| stack << child }
end
@@ -141,7 +127,7 @@ module Prism
sorted << AnonymousLocal if params.keywords.any?
if params.keyword_rest.is_a?(ForwardingParameterNode)
- sorted.push(:*, :&, :"...")
+ sorted.push(:*, :**, :&, :"...")
elsif params.keyword_rest.is_a?(KeywordRestParameterNode)
sorted << params.keyword_rest.name if params.keyword_rest.name
end