From d02455afc1a73d2e248890f07ae7888b52294f5a Mon Sep 17 00:00:00 2001 From: Matthew Healy Date: Sun, 7 Jan 2024 13:54:43 +0100 Subject: [PATCH] [ruby/prism] Add comments documenting RangeNode fields https://github.com/ruby/prism/commit/e6aef6499b --- prism/config.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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.