diff options
author | TSUYUSATO Kitsune <make.just.on@gmail.com> | 2023-11-09 16:01:37 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-11-09 08:37:20 +0000 |
commit | fae44d652477292ddc66c76111bdaf25f84267fe (patch) | |
tree | 8dc172de5a52c3734a3afb40160b9b23a507533f /test/prism/snapshots | |
parent | b73e087dbc91cf47ebff79e5eaa7a8ab2795a5e0 (diff) | |
download | ruby-fae44d652477292ddc66c76111bdaf25f84267fe.tar.gz |
[ruby/prism] Reset do_loop_stack around a body of a endless method definition
Fix https://github.com/ruby/prism/pull/1772
https://github.com/ruby/prism/commit/cdf58e845e
Diffstat (limited to 'test/prism/snapshots')
-rw-r--r-- | test/prism/snapshots/while.txt | 121 |
1 files changed, 79 insertions, 42 deletions
diff --git a/test/prism/snapshots/while.txt b/test/prism/snapshots/while.txt index 0ebae18e38..0fdcfe10c1 100644 --- a/test/prism/snapshots/while.txt +++ b/test/prism/snapshots/while.txt @@ -1,8 +1,8 @@ -@ ProgramNode (location: (1,0)-(19,52)) +@ ProgramNode (location: (1,0)-(21,31)) ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(19,52)) - └── body: (length: 10) + @ StatementsNode (location: (1,0)-(21,31)) + └── body: (length: 11) ├── @ WhileNode (location: (1,0)-(1,18)) │ ├── keyword_loc: (1,0)-(1,5) = "while" │ ├── closing_loc: (1,15)-(1,18) = "end" @@ -239,46 +239,83 @@ │ │ ├── arguments: ∅ │ │ └── keyword_loc: (17,38)-(17,43) = "break" │ └── flags: ∅ - └── @ WhileNode (location: (19,0)-(19,52)) - ├── keyword_loc: (19,0)-(19,5) = "while" - ├── closing_loc: (19,49)-(19,52) = "end" + ├── @ WhileNode (location: (19,0)-(19,52)) + │ ├── keyword_loc: (19,0)-(19,5) = "while" + │ ├── closing_loc: (19,49)-(19,52) = "end" + │ ├── predicate: + │ │ @ SingletonClassNode (location: (19,6)-(19,40)) + │ │ ├── locals: [:a] + │ │ ├── class_keyword_loc: (19,6)-(19,11) = "class" + │ │ ├── operator_loc: (19,12)-(19,14) = "<<" + │ │ ├── expression: + │ │ │ @ SelfNode (location: (19,15)-(19,19)) + │ │ ├── body: + │ │ │ @ StatementsNode (location: (19,21)-(19,35)) + │ │ │ └── body: (length: 1) + │ │ │ └── @ LocalVariableWriteNode (location: (19,21)-(19,35)) + │ │ │ ├── name: :a + │ │ │ ├── depth: 0 + │ │ │ ├── name_loc: (19,21)-(19,22) = "a" + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (19,25)-(19,35)) + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── message_loc: (19,25)-(19,28) = "tap" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── block: + │ │ │ │ │ @ BlockNode (location: (19,29)-(19,35)) + │ │ │ │ │ ├── locals: [] + │ │ │ │ │ ├── parameters: ∅ + │ │ │ │ │ ├── body: ∅ + │ │ │ │ │ ├── opening_loc: (19,29)-(19,31) = "do" + │ │ │ │ │ └── closing_loc: (19,32)-(19,35) = "end" + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :tap + │ │ │ └── operator_loc: (19,23)-(19,24) = "=" + │ │ └── end_keyword_loc: (19,37)-(19,40) = "end" + │ ├── statements: + │ │ @ StatementsNode (location: (19,42)-(19,47)) + │ │ └── body: (length: 1) + │ │ └── @ BreakNode (location: (19,42)-(19,47)) + │ │ ├── arguments: ∅ + │ │ └── keyword_loc: (19,42)-(19,47) = "break" + │ └── flags: ∅ + └── @ WhileNode (location: (21,0)-(21,31)) + ├── keyword_loc: (21,0)-(21,5) = "while" + ├── closing_loc: (21,28)-(21,31) = "end" ├── predicate: - │ @ SingletonClassNode (location: (19,6)-(19,40)) - │ ├── locals: [:a] - │ ├── class_keyword_loc: (19,6)-(19,11) = "class" - │ ├── operator_loc: (19,12)-(19,14) = "<<" - │ ├── expression: - │ │ @ SelfNode (location: (19,15)-(19,19)) + │ @ DefNode (location: (21,6)-(21,26)) + │ ├── name: :foo + │ ├── name_loc: (21,10)-(21,13) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: ∅ │ ├── body: - │ │ @ StatementsNode (location: (19,21)-(19,35)) + │ │ @ StatementsNode (location: (21,16)-(21,26)) │ │ └── body: (length: 1) - │ │ └── @ LocalVariableWriteNode (location: (19,21)-(19,35)) - │ │ ├── name: :a - │ │ ├── depth: 0 - │ │ ├── name_loc: (19,21)-(19,22) = "a" - │ │ ├── value: - │ │ │ @ CallNode (location: (19,25)-(19,35)) - │ │ │ ├── receiver: ∅ - │ │ │ ├── call_operator_loc: ∅ - │ │ │ ├── message_loc: (19,25)-(19,28) = "tap" - │ │ │ ├── opening_loc: ∅ - │ │ │ ├── arguments: ∅ - │ │ │ ├── closing_loc: ∅ - │ │ │ ├── block: - │ │ │ │ @ BlockNode (location: (19,29)-(19,35)) - │ │ │ │ ├── locals: [] - │ │ │ │ ├── parameters: ∅ - │ │ │ │ ├── body: ∅ - │ │ │ │ ├── opening_loc: (19,29)-(19,31) = "do" - │ │ │ │ └── closing_loc: (19,32)-(19,35) = "end" - │ │ │ ├── flags: ∅ - │ │ │ └── name: :tap - │ │ └── operator_loc: (19,23)-(19,24) = "=" - │ └── end_keyword_loc: (19,37)-(19,40) = "end" - ├── statements: - │ @ StatementsNode (location: (19,42)-(19,47)) - │ └── body: (length: 1) - │ └── @ BreakNode (location: (19,42)-(19,47)) - │ ├── arguments: ∅ - │ └── keyword_loc: (19,42)-(19,47) = "break" + │ │ └── @ CallNode (location: (21,16)-(21,26)) + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── message_loc: (21,16)-(21,19) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── block: + │ │ │ @ BlockNode (location: (21,20)-(21,26)) + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (21,20)-(21,22) = "do" + │ │ │ └── closing_loc: (21,23)-(21,26) = "end" + │ │ ├── flags: ∅ + │ │ └── name: :bar + │ ├── locals: [] + │ ├── def_keyword_loc: (21,6)-(21,9) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (21,14)-(21,15) = "=" + │ └── end_keyword_loc: ∅ + ├── statements: ∅ └── flags: ∅ |