From 04ae8fb3a953454b6d79f239e28fc779e76aaff4 Mon Sep 17 00:00:00 2001 From: Matthew Healy Date: Sun, 7 Jan 2024 10:56:22 +0100 Subject: [ruby/prism] Add comments for AssocNode fields https://github.com/ruby/prism/commit/fb60072a1e --- prism/config.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/prism/config.yml b/prism/config.yml index 85fe563c23..659a81396c 100644 --- a/prism/config.yml +++ b/prism/config.yml @@ -543,10 +543,35 @@ nodes: fields: - name: key type: node + comment: | + The key of the association. This can be any node. + + { a: b } + ^ + + { foo => bar } + ^^^ + + { def a; end => 1 } + ^^^^^^^^^^ - name: value type: node? + comment: | + The value of the association, if present. This can be any node. Will + not be present if, e.g., this node is an element of a `HashPatternNode`. + + { foo => bar } + ^^^ + + { x: 1 } + ^ - name: operator_loc type: location? + comment: | + The location of the `=>` operator, if present. + + { foo => bar } + ^^ comment: | Represents a hash key/value pair. -- cgit v1.2.3