From: ibylich@... Date: 2020-12-23T15:34:44+00:00 Subject: [ruby-core:101651] [Ruby master Bug#17431] paren_nest is not reset in parse.y after "foo.[]= value" Issue #17431 has been reported by ibylich (Ilya Bylich). ---------------------------------------- Bug #17431: paren_nest is not reset in parse.y after "foo.[]= value" https://bugs.ruby-lang.org/issues/17431 * Author: ibylich (Ilya Bylich) * Status: Open * Priority: Normal * ruby -v: ruby 3.0.0dev (2020-12-23T14:40:04Z master 94015200b6) [x86_64-darwin19] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- `p->lex.paren_nest` is equal to 1 after the following code: ```ruby 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. -- https://bugs.ruby-lang.org/ Unsubscribe: