merge revision(s) 49140: [Backport #10693]

* parse.y (f_label): return tLABEL value as it is.
	  [ruby-core:67315] [Bug #10693]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@49280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2015-01-16 08:35:53 +00:00
parent 008c7b108b
commit ed5aa4217c
4 changed files with 27 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Fri Jan 16 17:34:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (f_label): return tLABEL value as it is.
[ruby-core:67315] [Bug #10693]
Fri Jan 16 16:49:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com> Fri Jan 16 16:49:04 2015 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
* lib/net/http.rb (Net::HTTP#send_request): there is no response body * lib/net/http.rb (Net::HTTP#send_request): there is no response body

View file

@ -4720,9 +4720,9 @@ f_arg : f_arg_item
f_label : tLABEL f_label : tLABEL
{ {
ID id = get_id($1); ID id = get_id($1);
$$ = formal_argument(id); arg_var(formal_argument(id));
arg_var($$);
current_arg = id; current_arg = id;
$$ = $1;
} }
; ;

View file

@ -751,15 +751,31 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
end end
def test_params def test_params
arg = nil
thru_params = false thru_params = false
parse('a {||}', :on_params) {thru_params = true} parse('a {||}', :on_params) {|_, *v| thru_params = true; arg = v}
assert_equal true, thru_params assert_equal true, thru_params
assert_equal [nil, nil, nil, nil, nil, nil, nil], arg
thru_params = false thru_params = false
parse('a {|x|}', :on_params) {thru_params = true} parse('a {|x|}', :on_params) {|_, *v| thru_params = true; arg = v}
assert_equal true, thru_params assert_equal true, thru_params
assert_equal [["x"], nil, nil, nil, nil, nil, nil], arg
thru_params = false thru_params = false
parse('a {|*x|}', :on_params) {thru_params = true} parse('a {|*x|}', :on_params) {|_, *v| thru_params = true; arg = v}
assert_equal true, thru_params assert_equal true, thru_params
assert_equal [nil, nil, "*x", nil, nil, nil, nil], arg
thru_params = false
parse('a {|x: 1|}', :on_params) {|_, *v| thru_params = true; arg = v}
assert_equal true, thru_params
assert_equal [nil, nil, nil, nil, [["x:", "1"]], nil, nil], arg
thru_params = false
parse('a {|x:|}', :on_params) {|_, *v| thru_params = true; arg = v}
assert_equal true, thru_params
assert_equal [nil, nil, nil, nil, [["x:", false]], nil, nil], arg
thru_params = false
parse('a {|**x|}', :on_params) {|_, *v| thru_params = true; arg = v}
assert_equal true, thru_params
assert_equal [nil, nil, nil, nil, nil, "x", nil], arg
end end
def test_paren def test_paren

View file

@ -1,6 +1,6 @@
#define RUBY_VERSION "2.2.0" #define RUBY_VERSION "2.2.0"
#define RUBY_RELEASE_DATE "2015-01-16" #define RUBY_RELEASE_DATE "2015-01-16"
#define RUBY_PATCHLEVEL 12 #define RUBY_PATCHLEVEL 13
#define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 1 #define RUBY_RELEASE_MONTH 1