ruby-changes:55063
From: ktsj <ko1@a...>
Date: Sat, 16 Mar 2019 13:00:20 +0900 (JST)
Subject: [ruby-changes:55063] ktsj:r67270 (trunk): dsym should be treated as string [Bug #15670]
ktsj 2019-03-16 13:00:14 +0900 (Sat, 16 Mar 2019) New Revision: 67270 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67270 Log: dsym should be treated as string [ruby-core:91852] [Bug #15670] Modified files: trunk/parse.y trunk/test/ripper/test_sexp.rb Index: parse.y =================================================================== --- parse.y (revision 67269) +++ parse.y (revision 67270) @@ -3796,7 +3796,7 @@ sym : fname https://github.com/ruby/ruby/blob/trunk/parse.y#L3796 | tCVAR ; -dsym : tSYMBEG xstring_contents tSTRING_END +dsym : tSYMBEG string_contents tSTRING_END { SET_LEX_STATE(EXPR_END); /*%%%*/ Index: test/ripper/test_sexp.rb =================================================================== --- test/ripper/test_sexp.rb (revision 67269) +++ test/ripper/test_sexp.rb (revision 67270) @@ -132,4 +132,12 @@ eot https://github.com/ruby/ruby/blob/trunk/test/ripper/test_sexp.rb#L132 end end end + + def test_dsym + bug15670 = '[ruby-core:91852]' + _, (_, _, s) = Ripper.sexp_raw(%q{:"sym"}) + assert_equal([:dyna_symbol, [:string_add, [:string_content], [:@tstring_content, "sym", [1, 2]]]], + s, + bug15670) + end end if ripper_test -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/