ruby-changes:61711
From: Nobuyoshi <ko1@a...>
Date: Sun, 14 Jun 2020 16:09:46 +0900 (JST)
Subject: [ruby-changes:61711] b22bfdaa9a (master): Fixed up rest, keywords, keyword rest and block arguments
https://git.ruby-lang.org/ruby.git/commit/?id=b22bfdaa9a From b22bfdaa9ad0ae96f79ee75503c85908fa2ec934 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 14 Jun 2020 16:08:33 +0900 Subject: Fixed up rest, keywords, keyword rest and block arguments diff --git a/tool/mk_builtin_loader.rb b/tool/mk_builtin_loader.rb index db2224c..f28f48f 100644 --- a/tool/mk_builtin_loader.rb +++ b/tool/mk_builtin_loader.rb @@ -53,8 +53,15 @@ def collect_params tree https://github.com/ruby/ruby/blob/trunk/tool/mk_builtin_loader.rb#L53 while tree case tree.first when :params - idents = (tree[1] || []) + (tree[2] || []).map(&:first) - return idents.map { |ident| ident[1].to_sym } + params = [] + _, mand, opt, rest, post, kwds, kwrest, block = tree + mand.each {|_, v| params << v.to_sym} if mand + opt.each {|(_, v), | params << v.to_sym} if opt + params << rest[1][1].to_sym if rest + post.each {|_, v| params << v.to_sym} if post + params << kwrest[1][1].to_sym if kwrest + params << block[1][1].to_sym if block + return params when :paren tree = tree[1] else -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/