Skip to content

Commit

Permalink
Get the spec runner parsing
Browse files Browse the repository at this point in the history
I was trying to get test/natalie/method_test.rb parsing (and passing),
but I found a few unexpected results from YARP. I think these are bugs,
which I filed here:

ruby/prism#1435
ruby/prism#1436
  • Loading branch information
seven1m committed Sep 10, 2023
1 parent 84f7c07 commit 4536b29
Show file tree
Hide file tree
Showing 2 changed files with 394 additions and 37 deletions.
5 changes: 4 additions & 1 deletion lib/natalie/compiler/args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def transform_arg(arg)
arg = arg.new(:masgn, *array[1..-1])
end
transform_destructured_arg(arg)
when :splat
clean_up_keyword_args
transform_splat_arg(arg[1])
else
raise "I don't yet know how to compile #{arg.inspect}"
end
Expand Down Expand Up @@ -127,7 +130,7 @@ def transform_destructured_arg(arg)
end

def transform_splat_arg(arg)
name = arg[1..-1]
name = arg.to_s.tr('*', '').to_sym
if name.empty?
:noop
else
Expand Down

0 comments on commit 4536b29

Please sign in to comment.