[ruby/prism] Add document CallOrWriteNode fields
Partially: https://github.com/ruby/prism/issues/2123 https://github.com/ruby/prism/commit/3c01cc7c77
This commit is contained in:
parent
0f921cf41d
commit
917f348a0c
@ -1555,19 +1555,54 @@ nodes:
|
|||||||
- name: receiver
|
- name: receiver
|
||||||
type: node?
|
type: node?
|
||||||
kind: non-void expression
|
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
|
- name: call_operator_loc
|
||||||
type: location?
|
type: location?
|
||||||
|
comment: |
|
||||||
|
Represents the location of the call operator.
|
||||||
|
|
||||||
|
foo.bar ||= value
|
||||||
|
^
|
||||||
- name: message_loc
|
- name: message_loc
|
||||||
type: location?
|
type: location?
|
||||||
|
comment: |
|
||||||
|
Represents the location of the message.
|
||||||
|
|
||||||
|
foo.bar ||= value
|
||||||
|
^^^
|
||||||
- name: read_name
|
- name: read_name
|
||||||
type: constant
|
type: constant
|
||||||
|
comment: |
|
||||||
|
Represents the name of the method being called.
|
||||||
|
|
||||||
|
foo.bar ||= value # read_name `:bar`
|
||||||
|
^^^
|
||||||
- name: write_name
|
- name: write_name
|
||||||
type: constant
|
type: constant
|
||||||
|
comment: |
|
||||||
|
Represents the name of the method being written to.
|
||||||
|
|
||||||
|
foo.bar ||= value # write_name `:bar=`
|
||||||
|
^^^
|
||||||
- name: operator_loc
|
- name: operator_loc
|
||||||
type: location
|
type: location
|
||||||
|
comment: |
|
||||||
|
Represents the location of the operator.
|
||||||
|
|
||||||
|
foo.bar ||= value
|
||||||
|
^^^
|
||||||
- name: value
|
- name: value
|
||||||
type: node
|
type: node
|
||||||
kind: non-void expression
|
kind: non-void expression
|
||||||
|
comment: |
|
||||||
|
Represents the value being assigned.
|
||||||
|
|
||||||
|
foo.bar ||= value
|
||||||
|
^^^^^
|
||||||
comment: |
|
comment: |
|
||||||
Represents the use of the `||=` operator on a call.
|
Represents the use of the `||=` operator on a call.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user