summaryrefslogtreecommitdiff
path: root/lib/prism/pattern.rb
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2023-10-23 10:42:55 -0400
committergit <[email protected]>2023-10-27 02:09:33 +0000
commita40e2b8ee9632b07064af4c99efdafda814df391 ()
tree67c0817abf5ce62084a583b45e782cd205e6e6ec /lib/prism/pattern.rb
parent9a618b95cdee82b64257a248c31d49ae9f066fea (diff)
[ruby/prism] Fix parsing lone assoc splat within hash patterns
https://.com/ruby/prism/commit/1da5e05672
-rw-r--r--lib/prism/pattern.rb6
1 files changed, 3 insertions, 3 deletions
@@ -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?
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)]
end
compiled_keywords = ->(other) do