Forum: Ruby-dev ruby -c and ripper inconsistency: /*/

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-12-01 00:38
(Received via mailing list)
Issue #10437 has been updated by Nobuyoshi Nakada.

Related to Bug #10543: ruby -c and ripper inconsistency:
/(?<n>a(b|\g<n>))/ added

----------------------------------------
Bug #10437: ruby -c and ripper inconsistency: /*/
https://bugs.ruby-lang.org/issues/10437#change-50214

* Author: Akira Tanaka
* Status: Closed
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
/*/ という、間違った regexp リテラルは
ruby -c ではちゃんとエラーになるのですが、
Ripper.sexp ではエラーになりません。

```
% cat z.rb
/*/
% ruby -c z.rb
z.rb:1: target of repeat operator is not specified: /*/
% ruby -rripper -e 'p Ripper.sexp(STDIN.read)'  < z.rb
[:program, [[:regexp_literal, [[:@tstring_content, "*", [1, 1]]],
[:@regexp_end, "/", [1, 2]]]]]
% ruby -v
ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux]
```

Ripper では regexp object を作らないからでしょうが、
syntax error を調べる目的に対して不都合ではあります。
This topic is locked and can not be replied to.