summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Healy <matthew@liamhealy.xyz>2024-01-07 10:56:22 +0100
committergit <svn-admin@ruby-lang.org>2024-01-08 18:47:06 +0000
commit04ae8fb3a953454b6d79f239e28fc779e76aaff4 (patch)
tree9b421246cd0d596629d598e788a27bfa66204496
parent7e09dd433b2230c6bf4158a5157c14246510b746 (diff)
[ruby/prism] Add comments for AssocNode fields
https://github.com/ruby/prism/commit/fb60072a1e
-rw-r--r--prism/config.yml25
1 files changed, 25 insertions, 0 deletions
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.