Skip to content

Commit

Permalink
dsym should be treated as string [ruby-core:91852] [Bug #15670]
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
k-tsj committed Mar 16, 2019
1 parent e4c184c commit 7006fde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -3796,7 +3796,7 @@ sym : fname
| tCVAR
;

dsym : tSYMBEG xstring_contents tSTRING_END
dsym : tSYMBEG string_contents tSTRING_END
{
SET_LEX_STATE(EXPR_END);
/*%%%*/
Expand Down
8 changes: 8 additions & 0 deletions test/ripper/test_sexp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,12 @@ def clear_pos(sexp)
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

0 comments on commit 7006fde

Please sign in to comment.