Actions
Bug #15673
closedNumber args + Ripper
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0dev (2019-03-18 trunk 67295) [x86_64-darwin18]
Description
Hi there -
Love the new number args for blocks. When I run
[1, 2, 3].map { @1 * 2 }
everything works. However, when I run:
require 'ripper'; Ripper.new('[1, 2, 3].map { @1 * 2 }').parse
it returns nothing and says there's an error.
Files
Updated by kddnewton (Kevin Newton) about 5 years ago
To be clear, I mean that:
require 'ripper'; Ripper.new('[1, 2, 3].map { @1 * 2 }').tap(&:parse).error?
returns true
Updated by kddnewton (Kevin Newton) about 5 years ago
Some more investigation yields that compile_error
is called with:
identifier false is not valid to get
Updated by kddnewton (Kevin Newton) about 5 years ago
- File ripper.patch ripper.patch added
I think I found it. I've attached a patch file. Please forgive me if I'm doing this wrong, this is my first contribution.
Updated by nobu (Nobuyoshi Nakada) about 5 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r67306.
parse.y: fix var_ref of numbered param in ripper
- parse.y (string_dvar, user_variable): register numbered
parameter in ripper for var_ref.
[ruby-core:91867] [Bug #15673]
Actions
Like0
Like0Like0Like0Like0