[ruby/prism] Add comments documenting RangeNode fields

https://github.com/ruby/prism/commit/e6aef6499b
This commit is contained in:
Matthew Healy 2024-01-07 13:54:43 +01:00 committed by git
parent 1e7d1da3b0
commit d02455afc1

View File

@ -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.