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 A23941F508 for ; Mon, 20 Jan 2025 06:41:43 +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=MLJfmJku; 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=sT+ogeWX; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1737355271; bh=SraCshe79Yfew+dwHZtjon/e/WKHQjVA8QzoZA7an8Y=; 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=MLJfmJkuITGKDWjnvzqESuPW2k/ks8hbvoajY6acgozcSjZLqnLUvzgu93yiQysWi vi1qNSCTXti1ednF7TLP2t9C5a9ej52CgPckwuiJv1K+RKOhB1IM0joTesloXy2lMC EA14nMcz901rTx0cFuEHOxFHj7PtGy8oDaH/mnTU= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 2170E4681E for ; Mon, 20 Jan 2025 06:41:11 +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=sT+ogeWX; 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 689674620F for ; Mon, 20 Jan 2025 06:41:05 +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=1fGIpkI4SpFdBpTY2K/cZsGXgO7aYXR+AQ7h62NqgTI=; b=sT+ogeWX1439Ne1R3f7wRe7WGbNyvu2nx4f5dN02Y0GGS18dWTZK1EbjuEl/OO1mFF+3 tTLMkdv9YQNJiMw7A2uN8C8pPpUCkLaHbrCUQfrbDJ0ZLbsnL2IRgR97r3lyhdTP+IOTR6 CBoEWSnmtga+zbKrVV72rUokZZmSg8bwh/8+rj3bZ2YLH1ufWY34VvJhp8bG3PMT6IqtZI fgRXyTegzL8A1Drj7CM28/q3CqhdKa7745iXp4dTZ1yBjpnJqpHiruyMGkWcaKEuJfmzBQ frbPAvKvhGMlXO+MYQwBOz+SRf2vbePec5tyNEUezRKJViPoU6anBhLfs11zX6kQ== Received: by recvd-69cbc48b94-g9g4n with SMTP id recvd-69cbc48b94-g9g4n-1-678DF000-D 2025-01-20 06:41:04.449964005 +0000 UTC m=+5735941.136147585 Received: from herokuapp.com (unknown) by geopod-ismtpd-16 (SG) with ESMTP id BoBDihiTTCO774PaRNRm5g for ; Mon, 20 Jan 2025 06:41:04.413 +0000 (UTC) Date: Mon, 20 Jan 2025 06:41:04 +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-Priority: Normal X-Redmine-Sender: Earlopain 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: 97428 X-SG-EID: =?us-ascii?Q?u001=2EeN8dK4P86Am4z06GVDKdfuyUr=2FYDMIW0L=2F3i+rfu20a8IqvHXr8dkK0nT?= =?us-ascii?Q?JnNCPZBfBfcBXIzVHSukhq0Fst8w76lX7vgcOKR?= =?us-ascii?Q?zLI=2FaLZlFeIaFrJXzrwTRob6jylciNw7k7vwujG?= =?us-ascii?Q?9Va53UW0oI2SgFMrpoWETtmPyxjQzgRr8hPMq3r?= =?us-ascii?Q?idTNTjvTJLDPxX2UYe7L4bLYSVFLQcpnDQEABni?= =?us-ascii?Q?Mjo8y8fFxt16C4n=2FTnUsXTKghXrB7XXFA=2FjNWXu?= =?us-ascii?Q?zv55Q998llxssyKC9n2T4K2Pfw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: IHKZRKWR5DHM6PU64Z5SONWWEOXO3VCY X-Message-ID-Hash: IHKZRKWR5DHM6PU64Z5SONWWEOXO3VCY 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:120742] [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: "Earlopain (Earlopain _) via ruby-core" Cc: "Earlopain (Earlopain _)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21048 has been updated by Earlopain (Earlopain _). Yes, I switched it up in the text. Fixed ---------------------------------------- Bug #21048: [Prism] rescue in modifier form with condition behaves differently https://bugs.ruby-lang.org/issues/21048#change-111573 * Author: Earlopain (Earlopain _) * Status: Open * 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`, not 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/