* [ruby-dev:48713] [ruby-trunk - Bug #10436] [Open] ruby -c and ripper inconsistency: m(&nil) {}
[not found] <redmine.issue-10436.20141028012456@ruby-lang.org>
@ 2014-10-28 1:24 ` akr
2019-08-21 3:49 ` [ruby-dev:50836] [Ruby master Bug#10436] " merch-redmine
2019-08-27 0:08 ` [ruby-dev:50840] " nobu
2 siblings, 0 replies; 3+ messages in thread
From: akr @ 2014-10-28 1:24 UTC (permalink / raw)
To: ruby-dev
Issue #10436 has been reported by Akira Tanaka.
----------------------------------------
Bug #10436: ruby -c and ripper inconsistency: m(&nil) {}
https://bugs.ruby-lang.org/issues/10436
* Author: Akira Tanaka
* Status: Open
* 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
----------------------------------------
m(&nil) {} というまちがったコードは
ruby -c でちゃんとエラーになるのに、
Ripper.sexp ではならないようです。
```
% cat z.rb
m(&nil) {}
% ruby -c z.rb
z.rb:1: both block arg and actual block given
% ruby -rripper -e 'p Ripper.sexp(STDIN.read)' < z.rb
[:program, [[:method_add_block, [:method_add_arg, [:fcall, [:@ident, "m", [1, 0]]], [:arg_paren, [:args_add_block, [], [:var_ref, [:@kw, "nil", [1, 3]]]]]], [:brace_block, nil, [[:void_stmt]]]]]]
% ruby -v
ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux]
```
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-dev:50836] [Ruby master Bug#10436] ruby -c and ripper inconsistency: m(&nil) {}
[not found] <redmine.issue-10436.20141028012456@ruby-lang.org>
2014-10-28 1:24 ` [ruby-dev:48713] [ruby-trunk - Bug #10436] [Open] ruby -c and ripper inconsistency: m(&nil) {} akr
@ 2019-08-21 3:49 ` merch-redmine
2019-08-27 0:08 ` [ruby-dev:50840] " nobu
2 siblings, 0 replies; 3+ messages in thread
From: merch-redmine @ 2019-08-21 3:49 UTC (permalink / raw)
To: ruby-dev
Issue #10436 has been updated by jeremyevans0 (Jeremy Evans).
File ripper-block_dup_check-10436.patch added
This bug still occurs in the master branch. Attached is a patch that fixes the problem by overriding `Ripper::SexpBuilder#on_method_add_block`. This isn't a very clean way to fix it, but I was not able to figure out a way to fix it by modifying `parse.y`.
----------------------------------------
Bug #10436: ruby -c and ripper inconsistency: m(&nil) {}
https://bugs.ruby-lang.org/issues/10436#change-80884
* Author: akr (Akira Tanaka)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
m(&nil) {} というまちがったコードは
ruby -c でちゃんとエラーになるのに、
Ripper.sexp ではならないようです。
```
% cat z.rb
m(&nil) {}
% ruby -c z.rb
z.rb:1: both block arg and actual block given
% ruby -rripper -e 'p Ripper.sexp(STDIN.read)' < z.rb
[:program, [[:method_add_block, [:method_add_arg, [:fcall, [:@ident, "m", [1, 0]]], [:arg_paren, [:args_add_block, [], [:var_ref, [:@kw, "nil", [1, 3]]]]]], [:brace_block, nil, [[:void_stmt]]]]]]
% ruby -v
ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux]
```
---Files--------------------------------
ripper-block_dup_check-10436.patch (2.2 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-dev:50840] [Ruby master Bug#10436] ruby -c and ripper inconsistency: m(&nil) {}
[not found] <redmine.issue-10436.20141028012456@ruby-lang.org>
2014-10-28 1:24 ` [ruby-dev:48713] [ruby-trunk - Bug #10436] [Open] ruby -c and ripper inconsistency: m(&nil) {} akr
2019-08-21 3:49 ` [ruby-dev:50836] [Ruby master Bug#10436] " merch-redmine
@ 2019-08-27 0:08 ` nobu
2 siblings, 0 replies; 3+ messages in thread
From: nobu @ 2019-08-27 0:08 UTC (permalink / raw)
To: ruby-dev
Issue #10436 has been updated by nobu (Nobuyoshi Nakada).
I'm overhauling ripper to multiplex the callback values and the parser union.
https://github.com/nobu/ruby/tree/ripper.value
----------------------------------------
Bug #10436: ruby -c and ripper inconsistency: m(&nil) {}
https://bugs.ruby-lang.org/issues/10436#change-81068
* Author: akr (Akira Tanaka)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
m(&nil) {} というまちがったコードは
ruby -c でちゃんとエラーになるのに、
Ripper.sexp ではならないようです。
```
% cat z.rb
m(&nil) {}
% ruby -c z.rb
z.rb:1: both block arg and actual block given
% ruby -rripper -e 'p Ripper.sexp(STDIN.read)' < z.rb
[:program, [[:method_add_block, [:method_add_arg, [:fcall, [:@ident, "m", [1, 0]]], [:arg_paren, [:args_add_block, [], [:var_ref, [:@kw, "nil", [1, 3]]]]]], [:brace_block, nil, [[:void_stmt]]]]]]
% ruby -v
ruby 2.2.0dev (2014-10-27 trunk 48168) [x86_64-linux]
```
---Files--------------------------------
ripper-block_dup_check-10436.patch (2.2 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-27 0:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <redmine.issue-10436.20141028012456@ruby-lang.org>
2014-10-28 1:24 ` [ruby-dev:48713] [ruby-trunk - Bug #10436] [Open] ruby -c and ripper inconsistency: m(&nil) {} akr
2019-08-21 3:49 ` [ruby-dev:50836] [Ruby master Bug#10436] " merch-redmine
2019-08-27 0:08 ` [ruby-dev:50840] " nobu
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 NNTP newsgroup(s).