summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-10-23 10:42:55 -0400
committergit <svn-admin@ruby-lang.org>2023-10-27 02:09:33 +0000
commita40e2b8ee9632b07064af4c99efdafda814df391 (patch)
tree67c0817abf5ce62084a583b45e782cd205e6e6ec /lib
parent9a618b95cdee82b64257a248c31d49ae9f066fea (diff)
[ruby/prism] Fix parsing lone assoc splat within hash patterns
https://github.com/ruby/prism/commit/1da5e05672
Diffstat (limited to 'lib')
-rw-r--r--lib/prism/pattern.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/prism/pattern.rb b/lib/prism/pattern.rb
index 0f606bc31f..01f5b0ef5a 100644
--- a/lib/prism/pattern.rb
+++ b/lib/prism/pattern.rb
@@ -158,12 +158,12 @@ module Prism
# in InstanceVariableReadNode[name: Symbol]
# in { name: Symbol }
def compile_hash_pattern_node(node)
- compile_error(node) unless node.kwrest.nil?
+ compile_error(node) if node.rest
compiled_constant = compile_node(node.constant) if node.constant
preprocessed =
- node.assocs.to_h do |assoc|
- [assoc.key.unescaped.to_sym, compile_node(assoc.value)]
+ node.elements.to_h do |element|
+ [element.key.unescaped.to_sym, compile_node(element.value)]
end
compiled_keywords = ->(other) do