Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Review config.yml: documentation, types and field names #2959

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^
Expand All @@ -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: |
Expand Down Expand Up @@ -1034,7 +1052,7 @@ nodes:
- name: operator_loc
type: location
comment: |
Represents block method arguments.
Represents a block argument using `&`.

bar(&args)
^^^^^^^^^^
Expand All @@ -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
Expand All @@ -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)
^^
Expand Down Expand Up @@ -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.

Expand Down
Loading