Skip to content

Commit

Permalink
Add document BlockNode fields
Browse files Browse the repository at this point in the history
Partially fixes: #2123
  • Loading branch information
ydah committed Nov 28, 2024
1 parent 93c0474 commit 9c0ef71
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1132,21 +1132,50 @@ nodes:
fields:
- name: locals
type: constant[]
comment: |
The local variables declared in the block.
[1, 2, 3].each { |i| puts x } # locals: [:i]
^
- name: parameters
type: node?
kind:
- BlockParametersNode
- NumberedParametersNode
- ItParametersNode
comment: |
The parameters of the block.
[1, 2, 3].each { |i| puts x }
^^^
[1, 2, 3].each { puts _1 }
^^^^^^^^^^^
[1, 2, 3].each { puts it }
^^^^^^^^^^^
- name: body
type: node?
kind:
- StatementsNode
- BeginNode
comment: |
The body of the block.
[1, 2, 3].each { |i| puts x }
^^^^^^
- name: opening_loc
type: location
comment: |
Represents the location of the opening `|`.
[1, 2, 3].each { |i| puts x }
^
- name: closing_loc
type: location
comment: |
Represents the location of the closing `|`.
[1, 2, 3].each { |i| puts x }
^
comment: |
Represents a block of ruby code.
Expand Down

0 comments on commit 9c0ef71

Please sign in to comment.