From: "jemmai (Jemma Issroff) via ruby-dev" <ruby-dev@ml.ruby-lang.org>
To: ruby-dev@ml.ruby-lang.org
Cc: "jemmai (Jemma Issroff)" <noreply@ruby-lang.org>
Subject: [ruby-dev:52059] [Ruby master Bug#10436] ruby -c and ripper inconsistency: m(&nil) {}
Date: Mon, 13 Nov 2023 19:41:43 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-105301.20231113194142.271@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-10436.20141028012456.271@ruby-lang.org
Issue #10436 has been updated by jemmai (Jemma Issroff).
This bug still exists on Ripper. Should we try revive @jeremyevans0's patch?
It is potentially worth noting that Prism creates a `ParseError`: "Multiple block arguments; only one block is allowed"
----------------------------------------
Bug #10436: ruby -c and ripper inconsistency: m(&nil) {}
https://bugs.ruby-lang.org/issues/10436#change-105301
* Author: akr (Akira Tanaka)
* Status: Open
* Priority: Normal
* 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/
next parent reply other threads:[~2023-11-13 19:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-10436.20141028012456.271@ruby-lang.org>
2023-11-13 19:41 ` jemmai (Jemma Issroff) via ruby-dev [this message]
2024-02-20 12:01 ` [ruby-dev:52068] [Ruby master Bug#10436] ruby -c and ripper inconsistency: m(&nil) {} yui-knk (Kaneko Yuichiro) via ruby-dev
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-105301.20231113194142.271@ruby-lang.org \
--to=ruby-dev@ruby-lang.org \
--cc=noreply@ruby-lang.org \
--cc=ruby-dev@ml.ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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).