From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 57DB11F4CC for ; Fri, 20 Dec 2024 23:15:56 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=Gu3TzIad; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=Sk91gZM3; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1734736524; bh=ZNsDzUkOg9JHT2TaIWRNBH8aDZKdnlfK/a8adrOF3ek=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=Gu3TzIady/xkltKjMyVQhwmrMNyF6Jsw9fehT5P/tJLOAgP8mhmBRlln5Z/JAmM1y 0CWPJrs7LPVXy/mTqJnCiuLTezNPuwBYrTMU0HvX4ciIBVqFzCYf5LIoR65x3TTj+K 0N6jM8mb2mHyC4McPlzm8+0nnYsT8+8vUEvWszhY= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 1A89545F32 for ; Fri, 20 Dec 2024 23:15:24 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=Sk91gZM3; dkim-atps=neutral Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 75C1444DDD for ; Fri, 20 Dec 2024 23:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=dYlJatlrRW0KHHEqtN4x2L4m7uLSHwQvJfVdeZu0D9I=; b=Sk91gZM3oExr9KIGvUhLCvkP2Zp+2AXtylJ6VX1UtA/3wDFSjqU6AXHEXHi6Tarr7oIs hOQ8S31eqbKo9fXIJorslRcyKcROl1hAV32Z8d6xvTEtN6CGpl1r/BzVXhDb9k+Qsw/+y3 g7YjeZpaY37ijnT7g7kuVfh1GBaSHzT9kc6GHDavVhamnUYW6v3CswhlmjLgiCp40KLTPv k3tzhsArvUl3HctQQs/n0p8fWhoc7ekXKIG800IAHh7BG+wCHPtLFJhsL/rsZ6H4nfLMBv o0hFq1UKHxh+ZvKZpDjPx/a/ZnlNxXhV1q/Vix6NmLoaz0Axl6Kc8hdQ3LGGowSA== Received: by recvd-84b546689d-nmml4 with SMTP id recvd-84b546689d-nmml4-1-6765FA85-C 2024-12-20 23:15:17.321412045 +0000 UTC m=+3117032.327724304 Received: from herokuapp.com (unknown) by geopod-ismtpd-18 (SG) with ESMTP id VHd4BCOTQhSJsmv11GIRiw for ; Fri, 20 Dec 2024 23:15:17.251 +0000 (UTC) Date: Fri, 20 Dec 2024 23:15:18 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20970 X-Redmine-Issue-Author: tompng X-Redmine-Issue-Priority: Normal X-Redmine-Sender: k0kubun X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 97026 X-SG-EID: =?us-ascii?Q?u001=2EsWSpkbcla4bB6tSlkOwdN01=2FLLwMflJlYDs0Ak3Gg6dwg4YUERnU2ZQsI?= =?us-ascii?Q?KPesnHmuO3R4nEnLV41FQje7rMJs=2FlByQKQxPtJ?= =?us-ascii?Q?4AIt7Pq58gDm5HCgXZdAfCUYRf1whoSO3ZJbED4?= =?us-ascii?Q?m1mERSpOLx4EHUSe=2FaDItebgbvnB7nqm6IEY2zj?= =?us-ascii?Q?eq5ekOkkrHx9=2Fyw6tayzzXFu5hxf6wRMYAgfcbB?= =?us-ascii?Q?qxfHQgn7wdh243fMjofgUbtJk0WJYrv14CVN5RP?= =?us-ascii?Q?f+IhQIpvXG1xBjNZdSQrx47zKg=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: GTZ6XYCU7IBEOO2SKM3GUWLAFBROLMTI X-Message-ID-Hash: GTZ6XYCU7IBEOO2SKM3GUWLAFBROLMTI X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:120349] [Ruby master Bug#20970] `it /1/i` raises undefined method 'it' for main (NoMethodError) even if binding.local_variables includes `it` List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "k0kubun (Takashi Kokubun) via ruby-core" Cc: "k0kubun (Takashi Kokubun)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20970 has been updated by k0kubun (Takashi Kokubun). > changed with #20969 I think you meant #20965 (https://github.com/ruby/ruby/pull/12398). > Before the change (on 3.4.0dev (2024-12-15T13:36:38Z master 366fd9642f)) it was an error both with Prism and parse.y > I feel commit:46fec0f62a1803d44edb8b06e39ac0f358e56670 makes a semantic change maybe too close to the release date. Do we really want this right now? It's too close to the release date to discuss and change how `it /1/i` in the ticket description's code is parsed. Since Matz said "the current master's behavior is good" before https://github.com/ruby/ruby/pull/12398, for the 3.4.0 release, `it /1/i` should be parsed like before the PR. As @zverok said, both parsers used to raise `NoMethodError`. Prism is good; it didn't change the behavior on the PR. `parse.y` now parses `it` in `it /1/i` as a local variable (`(it / 1) / i`), but `parse.y` should raise a `NoMethodError` (`it( /1/i )`). The same applies to `[1].each { p it; [5].each { p it } }`. Prism didn't change the behavior, but `parse.y` should be changed back to print `1` and `5`. @nobu said he's looking into the `[1].each { p it; [5].each { p it } }` issue last night, so I'd like to wait for his `parse.y` fix for now, hoping that the `it /1/i` case is fixed as well. We could revert https://github.com/ruby/ruby/pull/12398 as a last resort, but it'd be nice to not return the weird `nil` in #20955. ---------------------------------------- Bug #20970: `it /1/i` raises undefined method 'it' for main (NoMethodError) even if binding.local_variables includes `it` https://bugs.ruby-lang.org/issues/20970#change-111127 * Author: tompng (tomoya ishida) * Status: Open * ruby -v: ruby 3.4.0dev (2024-12-19T07:16:12Z master 335bba0fde) +PRISM [x86_64-linux] * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED ---------------------------------------- `it` parameter became a local variable with #20965, but it does not behave like local variable with `--parser=prism` ~~~ruby i=2 42.tap do p it # 42 p local_variables # [:it, :i] p it /1/i # should be 21, got NoMethodError end ~~~ It prints `42`, `[:it, :i], `21` with `--parser=parse.y` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/