Forum: Ruby-dev [Closed] ruby -c and ripper inconsistency: /(?<n>a(b|\g<n>))/

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (nobu)
on 2014-11-30 12:06
(Received via mailing list)
Issue #10543 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed
% Done changed from 0 to 100

Applied in changeset r48655.

----------
parse.y: fix a typo

* parse.y (regexp_contents): fix a typo.  pointed out by wanabe.
  [ruby-dev:48741] [Bug #10543]

----------------------------------------
Bug #10543: ruby -c and ripper inconsistency: /(?<n>a(b|\g<n>))/
https://bugs.ruby-lang.org/issues/10543#change-50204

* Author: Akira Tanaka
* Status: Closed
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby 2.2.0dev (2014-11-26 trunk 48577) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
以下のように、/(?<n>a(b|\g<n>))/ というだけのソースは
ruby -c では問題無しとなりますが、
Ripper.sexp では構文木でなく nil が返ってきてしまいます。

```
% cat z.rb
/(?<n>a(b|\g<n>))/
% ./ruby -c z.rb
Syntax OK
% ./ruby -rripper -e 'p Ripper.sexp(STDIN.read)' < z.rb
nil
% ./ruby -v
ruby 2.2.0dev (2014-11-26 trunk 48577) [x86_64-linux]
```
This topic is locked and can not be replied to.