From 3c01cc7c77a6f0087aa4de2bce8bc0715568d00f Mon Sep 17 00:00:00 2001 From: ydah Date: Wed, 4 Dec 2024 02:50:01 +0900 Subject: [PATCH] Add document CallOrWriteNode fields Partially: https://github.com/ruby/prism/issues/2123 --- config.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/config.yml b/config.yml index afc3619a54..84cd3d7f65 100644 --- a/config.yml +++ b/config.yml @@ -1555,19 +1555,54 @@ nodes: - name: receiver type: node? kind: non-void expression + comment: | + The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). + + foo.bar ||= value + ^^^ - name: call_operator_loc type: location? + comment: | + Represents the location of the call operator. + + foo.bar ||= value + ^ - name: message_loc type: location? + comment: | + Represents the location of the message. + + foo.bar ||= value + ^^^ - name: read_name type: constant + comment: | + Represents the name of the method being called. + + foo.bar ||= value # read_name `:bar` + ^^^ - name: write_name type: constant + comment: | + Represents the name of the method being written to. + + foo.bar ||= value # write_name `:bar=` + ^^^ - name: operator_loc type: location + comment: | + Represents the location of the operator. + + foo.bar ||= value + ^^^ - name: value type: node kind: non-void expression + comment: | + Represents the value being assigned. + + foo.bar ||= value + ^^^^^ comment: | Represents the use of the `||=` operator on a call.