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 00AE01F508 for ; Tue, 21 Jan 2025 18:24:02 +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=iKjT0xaz; 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=qEuva1ly; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1737483810; bh=7t7P/KGSKaEXLGkumnXI28yr00nqmhU2ow0m2xNliJw=; 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=iKjT0xazfSKxy9negDCec7A5OFBrW31cuWBJg1pVBlHmH3vhyNyIuXYkmIWAuWv7g FJQTw5a1ZwZ4HJFLdmHsuYhvLiLrWJpDy1qbjei0rsklgBnnE5UTRtSjDSpScyM851 GdN2maytnctYD2B6nu7xAg50NtpuXHZMXhcqOUbU= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 2ABEB46A1B for ; Tue, 21 Jan 2025 18:23:30 +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=qEuva1ly; 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 990164687D for ; Tue, 21 Jan 2025 18:23:24 +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=8SjTDE5wvMJxr/8/6HF+68L6bT2VJSRzZI3q9Nh7zY4=; b=qEuva1ly9W2szwCu8ulzQVdpgQBIFbY1A+0KlZVHsL3KFcGMv+6RsHq43t4TKnwagH4W 8oZ3euY2JUotp1vh6iD9Sr9L6yBzYlC4JHvINPDJjhH5JlNcCnf18elBbBKCWgexCEnfDi oct/EyUBf70ei+tTVhpb6WJuGmTwjo8pZKLEYOm5YAoLvqf1+iTW/bqF8EEa1E/K/6JOCE pzoA1lHOMJJEfgPVgDNGN3cMzwn0T7to5AgPvJ+lYuHsqKY7FwymZxWT8gc7gmFJ8fcO7W Rli6gZfwF5ESz2/J4wfM5daNNTG/N8lEh0aWwJGa5+afMAeHu059av+E2AMiun1Q== Received: by recvd-69cbc48b94-f5rdb with SMTP id recvd-69cbc48b94-f5rdb-1-678FE61B-14 2025-01-21 18:23:23.664666438 +0000 UTC m=+5864516.859860352 Received: from herokuapp.com (unknown) by geopod-ismtpd-8 (SG) with ESMTP id _ZUj84xASeODZEoBIsE2Sw for ; Tue, 21 Jan 2025 18:23:23.619 +0000 (UTC) Date: Tue, 21 Jan 2025 18:23:23 +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: tenderlovemaking 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: 97469 X-SG-EID: =?us-ascii?Q?u001=2ElWMe69GVkz6xHw8adpMU6eTKSGZqJ7+E1FrjckpA7cvWAPDyDX2cAv9Do?= =?us-ascii?Q?wZtGRg2vsYQLU1U4jx+ljWd9jTs=2FpZn02mllaZG?= =?us-ascii?Q?4g2CkB4nYTDkYrEA=2F4gKneYVVw4ouBkH45wxYcn?= =?us-ascii?Q?xd8bR=2FqPP7KNnXnQozifLFNfsHOGxMxzbiZbz2k?= =?us-ascii?Q?yetv+UgSa3ROUA00mRf=2Fz7zZG7yZmnPntRN77G7?= =?us-ascii?Q?cx43oJzrXMIa+N5AONFdGWV3yCQY4F26d=2FR+htm?= =?us-ascii?Q?QDlWKMmVgUzbGtcTmn63cV82Ww=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: HNTXESWJLI5QAKNM42ECXPME7O2N4ITN X-Message-ID-Hash: HNTXESWJLI5QAKNM42ECXPME7O2N4ITN 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:120751] [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: "tenderlovemaking (Aaron Patterson) via ruby-core" Cc: "tenderlovemaking (Aaron Patterson)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21048 has been updated by tenderlovemaking (Aaron Patterson). Assignee set to prism ---------------------------------------- Bug #21048: [Prism] rescue in modifier form with condition behaves differently https://bugs.ruby-lang.org/issues/21048#change-111614 * Author: Earlopain (Earlopain _) * Status: Open * 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: UNKNOWN ---------------------------------------- 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/