Issue #10405 has been updated by Nobuyoshi Nakada.

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

Applied in changeset r48144.

----------
parse.y: Ripper.sexp returns error

* ext/ripper/lib/ripper/sexp.rb (Ripper.sexp, Ripper.sexp_raw):
  return nil on error.  [ruby-dev:48678] [Bug #10405]

----------------------------------------
Bug #10405: syntax error inconsistency between ruby -c and ripper
https://bugs.ruby-lang.org/issues/10405#change-49645

* Author: Akira Tanaka
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: ext
* Target version: current: 2.2.0
* ruby -v: ruby 2.2.0dev (2014-10-20 trunk 48052) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
以下のように、a / b c という内容のファイルを
ruby -c で検査すると syntax errorになるのですが
Ripper.sexp に適用するとなにか構文木が返ってきます。

```
% cat z.rb
a / b c
% ./ruby -c z.rb
z.rb:1: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
zsh: exit 1     ./ruby -c z.rb
% ./ruby -rripper -e 'p Ripper.sexp(STDIN.read)' < z.rb
[:program, [:vcall, [:@ident, "c", [1, 6]]]]
% ./ruby -v
ruby 2.2.0dev (2014-10-20 trunk 48052) [x86_64-linux]
```

これは変な気がするんですがどうでしょうか。




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