From: "Kai (kai matsudate) via ruby-core" Date: 2026-06-08T16:13:25+00:00 Subject: [ruby-core:125643] [Ruby Bug#22095] Prism rejects a multiple assignment in a rescue modifier value that parse.y accepts Issue #22095 has been reported by Kai (kai matsudate). ---------------------------------------- Bug #22095: Prism rejects a multiple assignment in a rescue modifier value that parse.y accepts https://bugs.ruby-lang.org/issues/22095 * Author: Kai (kai matsudate) * Status: Open * ruby -v: ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [arm64-darwin25] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- ## Problem parse.y and Prism parse the following differently: ```ruby a rescue b, c = 1 ``` parse.y accepts it, but Prism rejects it. ## Cause In the grammar, the value of a rescue modifier is a statement, so it may itself be a multiple assignment. In Prism, multiple-assignment detection is only enabled at the statement level (`PM_BINDING_POWER_STATEMENT`). But Prism parses the rescue value with the rescue modifier's right binding power (`PM_BINDING_POWER_COMPOSITION`), so it does not recognize the multiple assignment and fails at the comma. I opened a draft PR with a proposed fix: https://github.com/ruby/prism/pull/4128 -- 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/