ruby-changes:41337
From: nobu <ko1@a...>
Date: Sat, 2 Jan 2016 11:11:08 +0900 (JST)
Subject: [ruby-changes:41337] nobu:r53409 (trunk): parse.y: yylval.num should be u3
nobu 2016-01-02 11:11:09 +0900 (Sat, 02 Jan 2016) New Revision: 53409 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53409 Log: parse.y: yylval.num should be u3 * parse.y (set_yylval_num): should be used as nd_state, set to u3. [ruby-core:72638] [Bug #11932] Modified files: trunk/ChangeLog trunk/parse.y trunk/test/ripper/test_ripper.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 53408) +++ ChangeLog (revision 53409) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Jan 2 11:11:01 2016 Nobuyoshi Nakada <nobu@r...> + + * parse.y (set_yylval_num): should be used as nd_state, set to u3. + [ruby-core:72638] [Bug #11932] + Sat Jan 2 02:27:22 2016 Marc-Andre Lafortune <ruby-core@m...> * lib/ostruct.rb: Fix case of frozen object with initializer. Index: test/ripper/test_ripper.rb =================================================================== --- test/ripper/test_ripper.rb (revision 53408) +++ test/ripper/test_ripper.rb (revision 53409) @@ -61,4 +61,15 @@ class TestRipper::Ripper < Test::Unit::T https://github.com/ruby/ruby/blob/trunk/test/ripper/test_ripper.rb#L61 assert_predicate @ripper, :yydebug end + def test_regexp_with_option + bug11932 = '[ruby-core:72638] [Bug #11932]' + src = '/[\xC0-\xF0]/u'.force_encoding(Encoding::UTF_8) + ripper = Ripper.new(src) + ripper.parse + assert_predicate(ripper, :error?) + src = '/[\xC0-\xF0]/n'.force_encoding(Encoding::UTF_8) + ripper = Ripper.new(src) + ripper.parse + assert_not_predicate(ripper, :error?, bug11932) + end end if ripper_test Index: parse.y =================================================================== --- parse.y (revision 53408) +++ parse.y (revision 53409) @@ -5251,7 +5251,7 @@ ripper_yylval_id(ID x) https://github.com/ruby/ruby/blob/trunk/parse.y#L5251 return ripper_new_yylval(x, ID2SYM(x), 0); } # define set_yylval_str(x) (yylval.val = (x)) -# define set_yylval_num(x) (yylval.val = ripper_new_yylval((x), 0, 0)) +# define set_yylval_num(x) (yylval.val = ripper_new_yylval(0, 0, (x))) # define set_yylval_id(x) (void)(x) # define set_yylval_name(x) (void)(yylval.val = ripper_yylval_id(x)) # define set_yylval_literal(x) (void)(x) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/