ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: ujihisa@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:92269] [Ruby trunk Bug#15670] Ripper treats :"sym" as xstring
Date: Sat, 13 Apr 2019 05:19:46 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-77602.20190413051945.43775f7411e10aa0@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15670.20190316035425@ruby-lang.org

Issue #15670 has been updated by ujihisa (Tatsuhiro Ujihisa).


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.


----------------------------------------
Bug #15670: Ripper treats :"sym" as xstring
https://bugs.ruby-lang.org/issues/15670#change-77602

* Author: ktsj (Kazuki Tsujimoto)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-03-15 master 67269) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: REQUIRED, 2.6: DONE
----------------------------------------
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]]]]
~~~

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




-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2019-04-13  5:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-15670.20190316035425@ruby-lang.org>
2019-03-16  3:54 ` [ruby-core:91852] [Ruby trunk Bug#15670] Ripper treats :"sym" as xstring kazuki
2019-03-28  3:26 ` [ruby-core:92030] " naruse
2019-04-13  5:19 ` ujihisa [this message]
2019-05-09  2:55 ` [ruby-core:92601] " skalee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-77602.20190413051945.43775f7411e10aa0@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).