[ruby-core:124906] [Ruby Bug#21934] Prism and parse.y inconsistency in command call used with pattern match
Issue #21934 has been reported by tompng (tomoya ishida). ---------------------------------------- Bug #21934: Prism and parse.y inconsistency in command call used with pattern match https://bugs.ruby-lang.org/issues/21934 * Author: tompng (tomoya ishida) * Status: Open * ruby -v: ruby 4.1.0dev (2026-03-03T16:19:28Z master e30b5a06dc) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- These are syntax error in both parse.y and in Prism ~~~ruby a x in pattern a x: in pattern a &x in pattern a *x => pattern a x: => pattern a &x => pattern ~~~ These are all syntax error in parse.y, all syntax valid in Prism ~~~ruby a.b x in pattern a.b x: in pattern a.b &x in pattern a.b *x => pattern a.b x: => pattern a.b &x => pattern ~~~ I think this is related to https://github.com/ruby/prism/issues/3558, `A.print message:\nin 'BAR'` inside case-in was parsed as `(A.print message:) in 'BAR'`. -- https://bugs.ruby-lang.org/
Issue #21934 has been updated by mame (Yusuke Endoh). @kddnewton @tompng Can we close this ticket? ---------------------------------------- Bug #21934: Prism and parse.y inconsistency in command call used with pattern match https://bugs.ruby-lang.org/issues/21934#change-116705 * Author: tompng (tomoya ishida) * Status: Open * ruby -v: ruby 4.1.0dev (2026-03-03T16:19:28Z master e30b5a06dc) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- These are syntax error in both parse.y and in Prism ~~~ruby a x in pattern a x: in pattern a &x in pattern a *x => pattern a x: => pattern a &x => pattern ~~~ These are all syntax error in parse.y, all syntax valid in Prism ~~~ruby a.b x in pattern a.b x: in pattern a.b &x in pattern a.b *x => pattern a.b x: => pattern a.b &x => pattern ~~~ I think this is related to https://github.com/ruby/prism/issues/3558, `A.print message:\nin 'BAR'` inside case-in was parsed as `(A.print message:) in 'BAR'`. -- https://bugs.ruby-lang.org/
Issue #21934 has been updated by Earlopain (Earlopain _). Status changed from Open to Closed Yeah, it's fixed by https://github.com/ruby/prism/pull/3970 ---------------------------------------- Bug #21934: Prism and parse.y inconsistency in command call used with pattern match https://bugs.ruby-lang.org/issues/21934#change-116709 * Author: tompng (tomoya ishida) * Status: Closed * ruby -v: ruby 4.1.0dev (2026-03-03T16:19:28Z master e30b5a06dc) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- These are syntax error in both parse.y and in Prism ~~~ruby a x in pattern a x: in pattern a &x in pattern a *x => pattern a x: => pattern a &x => pattern ~~~ These are all syntax error in parse.y, all syntax valid in Prism ~~~ruby a.b x in pattern a.b x: in pattern a.b &x in pattern a.b *x => pattern a.b x: => pattern a.b &x => pattern ~~~ I think this is related to https://github.com/ruby/prism/issues/3558, `A.print message:\nin 'BAR'` inside case-in was parsed as `(A.print message:) in 'BAR'`. -- https://bugs.ruby-lang.org/
participants (3)
-
Earlopain (Earlopain _) -
mame (Yusuke Endoh) -
tompng (tomoya ishida)