Project

General

Profile

Actions

Bug #17431

closed

paren_nest is not reset in parse.y after "foo.[]= value"

Added by ibylich (Ilya Bylich) almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 3.0.0dev (2020-12-23T14:40:04Z master 94015200b6) [x86_64-darwin19]
[ruby-core:101651]

Description

p->lex.paren_nest is equal to 1 after the following code:

self.[]= foo

paren_nest is used to differentiate ... for ranges/forwarded arguments, and so ./miniruby -we 'foo.[]= bar, ...' gives no ... at EOL, should be parenthesized? warning (./miniruby -we 'foo.x= bar, ...' does).

Also it's used to differentiate kDO vs kDO_LAMBDA, so I believe there are code samples with lambdas and .[]= calls that can't be handled by Ruby but are technically valid.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0