Project

General

Profile

Bug #15670

Ripper treats :"sym" as xstring

Added by ktsj (Kazuki Tsujimoto) 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0dev (2019-03-15 master 67269) [x86_64-linux]
[ruby-core:91852]

Description

Ripperで :"sym" をパースするとxstringとして扱われるようになっていますが、
{"sym": ...} と同様にstringとして扱われるべきだと思います。

$ ruby -rripper -e '_, (_, _, s) = Ripper.sexp_raw(%q{:"sym"}); p s'
[:dyna_symbol, [:xstring_add, [:xstring_new], [:@tstring_content, "sym", [1, 2]]]]

$ ruby -rripper -e '_, (_, _, (_, (_, ((_, s))))) = Ripper.sexp_raw(%q{{"sym": 0}}); p s'
[:dyna_symbol, [:string_add, [:string_content], [:@tstring_content, "sym", [1, 2]]]]

バックポートすべきか微妙な修正のような気もしますが、一応バックポートチケットとして起票しておきます。

Associated revisions

Revision 7006fdec
Added by ktsj (Kazuki Tsujimoto) 7 months ago

dsym should be treated as string [ruby-core:91852] [Bug #15670]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 67270
Added by ktsj (Kazuki Tsujimoto) 7 months ago

dsym should be treated as string [ruby-core:91852] [Bug #15670]

Revision 8bf06cb9
Added by naruse (Yui NARUSE) 7 months ago

merge revision(s) 67270: [Backport #15670]

    dsym should be treated as string [ruby-core:91852] [Bug #15670]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 67352
Added by naruse (Yui NARUSE) 7 months ago

merge revision(s) 67270: [Backport #15670]

dsym should be treated as string [ruby-core:91852] [Bug #15670]

Revision 764fe09a
Added by usa (Usaku NAKAMURA) 6 months ago

merge revision(s) 67270: [Backport #15670]

    dsym should be treated as string [ruby-core:91852] [Bug #15670]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 67707
Added by usa (Usaku NAKAMURA) 6 months ago

merge revision(s) 67270: [Backport #15670]

dsym should be treated as string [ruby-core:91852] [Bug #15670]

History

#1

Updated by ktsj (Kazuki Tsujimoto) 7 months ago

  • Status changed from Open to Closed

Applied in changeset trunk|r67270.


dsym should be treated as string [ruby-core:91852] [Bug #15670]

Updated by naruse (Yui NARUSE) 7 months ago

  • Backport changed from 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: REQUIRED to 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: DONE

ruby_2_6 r67352 merged revision(s) 67270.

Updated by ujihisa (Tatsuhiro Ujihisa) 6 months ago

This change broke a library preval https://github.com/kddeisz/preval/issues/1, and potentially also breaks other libraries that uses Ripper. Since this is an incompatible change for Ripper.sexp, I guess backport requires a loud changelog note for developers who use ripper.

#4

Updated by usa (Usaku NAKAMURA) 6 months ago

  • Backport changed from 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: DONE to 2.4: WONTFIX, 2.5: DONE, 2.6: DONE

Updated by skalee (Sebastian Skalacki) 5 months ago

YARD is also broken, though I'm not sure how severe is that: https://github.com/lsegal/yard/issues/1243. I suspect this very change.

Also available in: Atom PDF