From: Yukihiro Matsumoto Date: 2011-06-12T03:55:31+09:00 Subject: [ruby-dev:43761] Re: [Ruby 1.9 - Bug #3456] bisarre comma まつもと ゆきひろです In message "Re: [ruby-dev:43760] Re: [Ruby 1.9 - Bug #3456] bisarre comma" on Sun, 12 Jun 2011 03:33:57 +0900, Yukihiro Matsumoto writes: |いや、見落としがあったのは事実で申し訳ない。とりあえずこんな |パッチを書いて見ました。ちょっと余裕がないのでテストできてま |せん。末尾がassocがケースはどうしようかなあ。 末尾assocの後ろにもカンマを許すパッチ。 --- a/parse.y +++ b/parse.y @@ -2418,6 +2418,18 @@ opt_paren_args : none opt_call_args : none | call_args + | args ',' + { + $$ = $1; + } + | args ',' assocs ',' + { + /*%%%*/ + $$ = arg_append($1, NEW_HASH($3)); + /*% + $$ = arg_add_assocs($1, $3); + %*/ + } ; call_args : command @@ -2491,10 +2503,6 @@ opt_block_arg : ',' block_arg { $$ = $2; } - | ',' - { - $$ = 0; - } | none { $$ = 0;