Skip to content

Commit

Permalink
Vestigial references to MethodArgs in .rb files
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Apr 15, 2015
1 parent 2d805c2 commit 0fe862b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 108 deletions.
55 changes: 1 addition & 54 deletions lib/ruby/stdlib/jruby/core_ext/method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,6 @@ def parameters
case method
when MethodArgs2
return Helpers.parameter_list_to_parameters(JRuby.runtime, method.parameter_list, true)
when MethodArgs
args_node = method.args_node

# "pre" required args
required_pre = args_node.pre
if required_pre
for req_pre_arg in required_pre.child_nodes
if req_pre_arg.kind_of? MultipleAsgn19Node
args_ary << [:req]
else
args_ary << [:req, req_pre_arg ? req_pre_arg.name.intern : nil]
end
end
end

# optional args in middle
optional = args_node.opt_args
if optional
for opt_arg in optional.child_nodes
args_ary << [:opt, opt_arg ? opt_arg.name.intern : nil]
end
end

# rest arg
if args_node.rest_arg >= 0
rest = args_node.rest_arg_node

if rest.kind_of? UnnamedRestArgNode
if rest.star?
args_ary << [:rest]
end
else
args_ary << [:rest, rest ? rest.name.intern : nil]
end
end

# "post" required args
required_post = args_node.post
if required_post
for req_post_arg in required_post.child_nodes
if req_post_arg.kind_of? MultipleAsgn19Node
args_ary << [:req]
else
args_ary << [:req, req_post_arg ? req_post_arg.name.intern : nil]
end
end
end

# block arg
block = args_node.block
if block
args_ary << [:block, block.name.intern]
end
else
if method.arity == Arity::OPTIONAL
args_ary << [:rest]
Expand All @@ -70,4 +17,4 @@ def parameters

args_ary
end
end
end
54 changes: 0 additions & 54 deletions lib/ruby/stdlib/jruby/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require 'jruby'

module JRuby
MethodArgs = org.jruby.internal.runtime.methods.MethodArgs
MethodArgs2 = org.jruby.internal.runtime.methods.MethodArgs2
IRMethodArgs = org.jruby.internal.runtime.methods.IRMethodArgs
Helpers = org.jruby.runtime.Helpers
Expand Down Expand Up @@ -63,59 +62,6 @@ def args
(0...(a.size)).step(2) do |i|
args_ary << (a[i+1] == "" ? [a[i].to_sym] : [a[i].to_sym, a[i+1].to_sym])
end
when MethodArgs
args_node = method.args_node

# "pre" required args
required_pre = args_node.pre
if required_pre
for req_pre_arg in required_pre.child_nodes
if req_pre_arg.kind_of? MultipleAsgn19Node
args_ary << [:req]
else
args_ary << [:req, req_pre_arg ? req_pre_arg.name.intern : nil]
end
end
end

# optional args in middle
optional = args_node.opt_args
if optional
for opt_arg in optional.child_nodes
args_ary << [:opt, opt_arg ? opt_arg.name.intern : nil]
end
end

# rest arg
if args_node.rest_arg >= 0
rest = args_node.rest_arg_node

if rest.kind_of? UnnamedRestArgNode
if rest.star?
args_ary << [:rest]
end
else
args_ary << [:rest, rest ? rest.name.intern : nil]
end
end

# "post" required args
required_post = args_node.post
if required_post
for req_post_arg in required_post.child_nodes
if req_post_arg.kind_of? MultipleAsgn19Node
args_ary << [:req]
else
args_ary << [:req, req_post_arg ? req_post_arg.name.intern : nil]
end
end
end

# block arg
block = args_node.block
if block
args_ary << [:block, block.name.intern]
end
else
if method.arity == Arity::OPTIONAL
args_ary << [:rest]
Expand Down

0 comments on commit 0fe862b

Please sign in to comment.