summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Healy <matthew@liamhealy.xyz>2024-01-07 13:54:43 +0100
committergit <svn-admin@ruby-lang.org>2024-01-08 18:47:17 +0000
commitd02455afc1a73d2e248890f07ae7888b52294f5a (patch)
treeec5609d26ba2bfc46fabd5c66128a23fb9e5464b
parent1e7d1da3b0798d92cde87578d9b267f9fb068c0a (diff)
[ruby/prism] Add comments documenting RangeNode fields
https://github.com/ruby/prism/commit/e6aef6499b
-rw-r--r--prism/config.yml28
1 files changed, 28 insertions, 0 deletions
diff --git a/prism/config.yml b/prism/config.yml
index 03d51d58a7..b72317ea95 100644
--- a/prism/config.yml
+++ b/prism/config.yml
@@ -2372,12 +2372,40 @@ nodes:
- name: flags
type: flags
kind: RangeFlags
+ comment: |
+ A flag indicating whether the range excludes the end value.
+
+ 1..3 # includes 3
+
+ 1...3 # excludes 3
- name: left
type: node?
+ comment: |
+ The left-hand side of the range, if present. Can be either `nil` or
+ a node representing any kind of expression that returns a non-void
+ value.
+ 1...
+ ^
+
+ hello...goodbye
+ ^^^^^
- name: right
type: node?
+ The right-hand side of the range, if present. Can be either `nil` or
+ a node representing any kind of expression that returns a non-void
+ value.
+
+ ..5
+ ^
+
+ 1...foo
+ ^^^
+ If neither right-hand or left-hand side was included, this will be a
+ MissingNode.
- name: operator_loc
type: location
+ comment: |
+ The location of the `..` or `...` operator.
comment: |
Represents the use of the `..` or `...` operators.