[ruby/prism] Review config.yml: documentation, types and field names

https://github.com/ruby/prism/commit/d43333539e
This commit is contained in:
Benoit Daloze 2024-07-25 22:49:42 +02:00 committed by git
parent 7c9bcdf397
commit d6764076a1

View File

@ -774,15 +774,25 @@ nodes:
fields:
- name: new_name
type: node
kind:
- GlobalVariableReadNode
- BackReferenceReadNode
- NumberedReferenceReadNode
comment: |
Represents the new name of the global variable that can be used after aliasing. This can be either a global variable, a back reference, or a numbered reference.
Represents the new name of the global variable that can be used after aliasing.
alias $foo $bar
^^^^
- name: old_name
type: node
kind:
- GlobalVariableReadNode
- BackReferenceReadNode
- NumberedReferenceReadNode
- SymbolNode # On parsing error of `alias $a b`
- MissingNode # On parsing error of `alias $a 42`
comment: |
Represents the old name of the global variable that could be used before aliasing. This can be either a global variable, a back reference, or a numbered reference.
Represents the old name of the global variable that can be used before aliasing.
alias $foo $bar
^^^^
@ -802,8 +812,16 @@ nodes:
fields:
- name: new_name
type: node
kind:
- SymbolNode
- InterpolatedSymbolNode
- name: old_name
type: node
kind:
- SymbolNode
- InterpolatedSymbolNode
- GlobalVariableReadNode # On parsing error of `alias a $b`
- MissingNode # On parsing error of `alias a 42`
- name: keyword_loc
type: location
comment: |
@ -1034,7 +1052,7 @@ nodes:
- name: operator_loc
type: location
comment: |
Represents block method arguments.
Represents a block argument using `&`.
bar(&args)
^^^^^^^^^^
@ -1054,8 +1072,15 @@ nodes:
type: constant[]
- name: parameters
type: node?
kind:
- BlockParametersNode
- NumberedParametersNode
- ItParametersNode
- name: body
type: node?
kind:
- StatementsNode
- BeginNode
- name: opening_loc
type: location
- name: closing_loc
@ -1075,7 +1100,7 @@ nodes:
- name: operator_loc
type: location
comment: |
Represents a block parameter to a method, block, or lambda definition.
Represents a block parameter of a method, block, or lambda definition.
def a(&b)
^^
@ -2164,6 +2189,9 @@ nodes:
end
- name: consequent
type: node?
kind:
- ElseNode
- IfNode
comment: |
Represents an `ElseNode` or an `IfNode` when there is an `else` or an `elsif` in the `if` statement.