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)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 375411F50E for ; Fri, 14 Feb 2025 05:09:46 +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=me242oaH; 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=uMY6hKja; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1739509784; bh=H1TDyH5JS/JCBhIU2E9sjkWxB4hKoajKAq1JF+U8tfM=; 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=me242oaHFte6xAJzlJ9siCztGo+gH9w+KuJvw4SlMYP8G6vWeAmVp6Mt7kRSHvS16 TWmQeeWc3fjaYLOf7Ex/tBJrdRgc+UpQVzGEzF7gHSIdbWqLTw8TUT2bq9SsT0D60C 3+8W+Pb35quoR3yjUtbWMUTvR5o4CcxQX+bPm92Q= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 3D73646C03 for ; Fri, 14 Feb 2025 05:09:44 +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=uMY6hKja; dkim-atps=neutral Received: from s.wfbtzhsv.outbound-mail.sendgrid.net (s.wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 6689446BB1 for ; Fri, 14 Feb 2025 05:08:11 +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=ZIplOFDfNAYbOTYlpGFf3KvgphrEleeQwr491VSNiAg=; b=uMY6hKjaXR8MWdkLaPwgs2OR6xenauKQt7zWP9y6aADpiGpGkJVDMEB0Z8pty/Brz3kd RcKE9tF1H8Dl4zJWU7C6sp+MnLDG0cXYo3GU1CGjJRiMx0cF05B5MEkv+jJSYT4uo6Gqma VSyORzOO2C89vdLaUWCSzFO00s66hdpxpCV+lEdkdUkOYbIsVw6tXEbEkN3+iPEzF5snop mamVgkWPedAb9fwKNR2uU26ipvNbWqvcwGHat9kMMF9hsPYTR+4WsvXVIq3AMy/XMGcXGf tU4H3jmXCmUhRiW3FlA/Tzry3ct/a7rYp55dP4NYXzXzz93srsDcGPSzqqieKfLg== Received: by recvd-5f54b5d587-zs5q6 with SMTP id recvd-5f54b5d587-zs5q6-1-67AECFB9-3 2025-02-14 05:08:09.107077582 +0000 UTC m=+7890303.670603856 Received: from herokuapp.com (unknown) by geopod-ismtpd-28 (SG) with ESMTP id mLSdgqBLT_G82qeD-sqeqw for ; Fri, 14 Feb 2025 05:08:09.041 +0000 (UTC) Date: Fri, 14 Feb 2025 05:08:09 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 21048 X-Redmine-Issue-Author: Earlopain X-Redmine-Issue-Assignee: Group (prism) 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: 97739 X-SG-EID: =?us-ascii?Q?u001=2EsWSpkbcla4bB6tSlkOwdN01=2FLLwMflJlYDs0Ak3Gg6dwg4YUERnU2ZQsI?= =?us-ascii?Q?KPesnHmuO3R4nEnLV41FQje7rMJs=2FlByQKQxPtJ?= =?us-ascii?Q?4AIt7Pq58gBWQr7Hvx+wtEDbN9gX1T7UOhk7FMJ?= =?us-ascii?Q?Pmv8jOFykcvTkdnwurHRkhTKsoDRFb=2FO7xjNGhI?= =?us-ascii?Q?DXvvRDNWpWLmx50OIc=2FjhXyDbR17UDXfGiYierq?= =?us-ascii?Q?MKlgKE1v9hVES6+n3Aj0joKeqaXxDQyotd7m0Kq?= =?us-ascii?Q?ZLIyAcTXS7S6QRYrnotO4aqtCA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 77H5S4MM4U3ODE7W2Y6NBLH2BT4IBO3W X-Message-ID-Hash: 77H5S4MM4U3ODE7W2Y6NBLH2BT4IBO3W 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:121019] [Ruby master Bug#21048] [Prism] rescue in modifier form with condition behaves differently 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 #21048 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: REQUIRED to 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: DONE ruby_3_4 commit:04298f2d158fa860293d2ed2779cba69bc47f404 merged revision(s) commit:c2908613368b2ae404d094a15df61d830fc46dc9. ---------------------------------------- Bug #21048: [Prism] rescue in modifier form with condition behaves differently https://bugs.ruby-lang.org/issues/21048#change-111927 * Author: Earlopain (Earlopain _) * Status: Closed * Assignee: prism * ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: DONE ---------------------------------------- With the following code there is a discrepancy in how prism and parse.y consider precedence: ```rb $called = false def foo $called = true end foo rescue nil if false puts "Called: #{$called}" ``` Prism interprets it as `foo rescue (nil if false)`, calling the method. `parse.y` does `(foo rescue nil) if false` since at least Ruby 2.0 ```sh $ ruby -v ruby 3.5.0dev (2025-01-19T12:44:20Z master f27ed98eff) +PRISM [x86_64-linux] $ ruby code.rb Called: true $ ruby --parser=parse.y code.rb Called: false ``` -- 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/