From 334c261cc9ee125c4c4bfc65dec2e571af8944a2 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sun, 30 Mar 2025 13:28:36 +0200 Subject: [ruby/prism] Fix parser translator when splatting in pattern matching pin Because it ends up treating it as a local variable, and `a.x` is not a valid local variable name. I'm not big on pattern matching, but conceptually it makes sense to me to treat anything inside ^() to not be pattern matching syntax? https://github.com/ruby/prism/commit/80dbd85c45 --- test/prism/fixtures/patterns.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/prism/fixtures/patterns.txt b/test/prism/fixtures/patterns.txt index 09584e43eb..449dac619b 100644 --- a/test/prism/fixtures/patterns.txt +++ b/test/prism/fixtures/patterns.txt @@ -218,3 +218,7 @@ a in b, and c a in b, or c (a in b,) and c (a in b,) or c + +x => ^([*a.x]) +x => ^([**a.x]) +x => ^({ a: }) -- cgit v1.2.3