diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-11-09 22:59:35 -0500 |
---|---|---|
committer | Kevin Newton <kddnewton@gmail.com> | 2023-11-20 18:00:44 -0500 |
commit | e269096d15a4488a8ae34aca38752989e61304c7 (patch) | |
tree | 7e92471855d8210d9b3d623437a664d8f378ef63 /test/prism/snapshots | |
parent | fa547cd70243710e90bf57377402cbbdf910efa3 (diff) | |
download | ruby-e269096d15a4488a8ae34aca38752989e61304c7.tar.gz |
[ruby/prism] Replace match write locals with match write targets
https://github.com/ruby/prism/commit/eec1862967
Diffstat (limited to 'test/prism/snapshots')
-rw-r--r-- | test/prism/snapshots/regex.txt | 126 | ||||
-rw-r--r-- | test/prism/snapshots/spanning_heredoc.txt | 5 | ||||
-rw-r--r-- | test/prism/snapshots/whitequark/lvar_injecting_match.txt | 5 |
3 files changed, 106 insertions, 30 deletions
diff --git a/test/prism/snapshots/regex.txt b/test/prism/snapshots/regex.txt index 722006c998..b69e5cc31e 100644 --- a/test/prism/snapshots/regex.txt +++ b/test/prism/snapshots/regex.txt @@ -1,8 +1,8 @@ -@ ProgramNode (location: (1,0)-(37,16)) -├── locals: [:foo, :ab, :abc] +@ ProgramNode (location: (1,0)-(40,24)) +├── locals: [:foo, :ab, :abc, :a] └── statements: - @ StatementsNode (location: (1,0)-(37,16)) - └── body: (length: 19) + @ StatementsNode (location: (1,0)-(40,24)) + └── body: (length: 21) ├── @ CallNode (location: (1,0)-(1,9)) │ ├── receiver: ∅ │ ├── call_operator_loc: ∅ @@ -116,7 +116,10 @@ │ │ │ │ ├── block: ∅ │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :=~ - │ │ │ └── locals: [:foo] + │ │ │ └── targets: (length: 1) + │ │ │ └── @ LocalVariableTargetNode (location: (11,5)-(11,8)) + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 │ │ └── @ LocalVariableReadNode (location: (11,23)-(11,26)) │ │ ├── name: :foo │ │ └── depth: 0 @@ -237,7 +240,10 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :=~ - │ └── locals: [:ab] + │ └── targets: (length: 1) + │ └── @ LocalVariableTargetNode (location: (32,0)-(33,4)) + │ ├── name: :ab + │ └── depth: 0 ├── @ LocalVariableReadNode (location: (33,12)-(33,14)) │ ├── name: :ab │ └── depth: 0 @@ -268,32 +274,96 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :=~ - │ └── locals: [:abc] + │ └── targets: (length: 1) + │ └── @ LocalVariableTargetNode (location: (35,4)-(35,7)) + │ ├── name: :abc + │ └── depth: 0 ├── @ LocalVariableReadNode (location: (35,26)-(35,29)) │ ├── name: :abc │ └── depth: 0 - └── @ CallNode (location: (37,0)-(37,16)) - ├── receiver: - │ @ RegularExpressionNode (location: (37,0)-(37,10)) - │ ├── opening_loc: (37,0)-(37,1) = "/" - │ ├── content_loc: (37,1)-(37,9) = "(?<a b>)" - │ ├── closing_loc: (37,9)-(37,10) = "/" - │ ├── unescaped: "(?<a b>)" - │ └── flags: ∅ + ├── @ CallNode (location: (37,0)-(37,16)) + │ ├── receiver: + │ │ @ RegularExpressionNode (location: (37,0)-(37,10)) + │ │ ├── opening_loc: (37,0)-(37,1) = "/" + │ │ ├── content_loc: (37,1)-(37,9) = "(?<a b>)" + │ │ ├── closing_loc: (37,9)-(37,10) = "/" + │ │ ├── unescaped: "(?<a b>)" + │ │ └── flags: ∅ + │ ├── call_operator_loc: ∅ + │ ├── message_loc: (37,11)-(37,13) = "=~" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (37,14)-(37,16)) + │ │ ├── arguments: (length: 1) + │ │ │ └── @ StringNode (location: (37,14)-(37,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (37,14)-(37,15) = "\"" + │ │ │ ├── content_loc: (37,15)-(37,15) = "" + │ │ │ ├── closing_loc: (37,15)-(37,16) = "\"" + │ │ │ └── unescaped: "" + │ │ └── flags: ∅ + │ ├── closing_loc: ∅ + │ ├── block: ∅ + │ ├── flags: ∅ + │ └── name: :=~ + ├── @ LocalVariableWriteNode (location: (39,0)-(39,5)) + │ ├── name: :a + │ ├── depth: 0 + │ ├── name_loc: (39,0)-(39,1) = "a" + │ ├── value: + │ │ @ IntegerNode (location: (39,4)-(39,5)) + │ │ └── flags: decimal + │ └── operator_loc: (39,2)-(39,3) = "=" + └── @ CallNode (location: (40,0)-(40,24)) + ├── receiver: ∅ ├── call_operator_loc: ∅ - ├── message_loc: (37,11)-(37,13) = "=~" + ├── message_loc: (40,0)-(40,3) = "tap" ├── opening_loc: ∅ - ├── arguments: - │ @ ArgumentsNode (location: (37,14)-(37,16)) - │ ├── arguments: (length: 1) - │ │ └── @ StringNode (location: (37,14)-(37,16)) - │ │ ├── flags: ∅ - │ │ ├── opening_loc: (37,14)-(37,15) = "\"" - │ │ ├── content_loc: (37,15)-(37,15) = "" - │ │ ├── closing_loc: (37,15)-(37,16) = "\"" - │ │ └── unescaped: "" - │ └── flags: ∅ + ├── arguments: ∅ ├── closing_loc: ∅ - ├── block: ∅ + ├── block: + │ @ BlockNode (location: (40,4)-(40,24)) + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (40,6)-(40,22)) + │ │ └── body: (length: 1) + │ │ └── @ MatchWriteNode (location: (40,6)-(40,22)) + │ │ ├── call: + │ │ │ @ CallNode (location: (40,6)-(40,22)) + │ │ │ ├── receiver: + │ │ │ │ @ RegularExpressionNode (location: (40,6)-(40,14)) + │ │ │ │ ├── opening_loc: (40,6)-(40,7) = "/" + │ │ │ │ ├── content_loc: (40,7)-(40,13) = "(?<a>)" + │ │ │ │ ├── closing_loc: (40,13)-(40,14) = "/" + │ │ │ │ ├── unescaped: "(?<a>)" + │ │ │ │ └── flags: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── message_loc: (40,15)-(40,17) = "=~" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (40,18)-(40,22)) + │ │ │ │ ├── arguments: (length: 1) + │ │ │ │ │ └── @ CallNode (location: (40,18)-(40,22)) + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── message_loc: (40,18)-(40,22) = "to_s" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── block: ∅ + │ │ │ │ │ ├── flags: variable_call + │ │ │ │ │ └── name: :to_s + │ │ │ │ └── flags: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── block: ∅ + │ │ │ ├── flags: ∅ + │ │ │ └── name: :=~ + │ │ └── targets: (length: 1) + │ │ └── @ LocalVariableTargetNode (location: (40,10)-(40,11)) + │ │ ├── name: :a + │ │ └── depth: 1 + │ ├── opening_loc: (40,4)-(40,5) = "{" + │ └── closing_loc: (40,23)-(40,24) = "}" ├── flags: ∅ - └── name: :=~ + └── name: :tap diff --git a/test/prism/snapshots/spanning_heredoc.txt b/test/prism/snapshots/spanning_heredoc.txt index f28aeb815a..ed9c03e608 100644 --- a/test/prism/snapshots/spanning_heredoc.txt +++ b/test/prism/snapshots/spanning_heredoc.txt @@ -352,4 +352,7 @@ │ ├── block: ∅ │ ├── flags: ∅ │ └── name: :=~ - └── locals: [:a] + └── targets: (length: 1) + └── @ LocalVariableTargetNode (location: (53,5)-(55,7)) + ├── name: :a + └── depth: 0 diff --git a/test/prism/snapshots/whitequark/lvar_injecting_match.txt b/test/prism/snapshots/whitequark/lvar_injecting_match.txt index 0d615cc11b..de6d5eb99a 100644 --- a/test/prism/snapshots/whitequark/lvar_injecting_match.txt +++ b/test/prism/snapshots/whitequark/lvar_injecting_match.txt @@ -30,7 +30,10 @@ │ │ ├── block: ∅ │ │ ├── flags: ∅ │ │ └── name: :=~ - │ └── locals: [:match] + │ └── targets: (length: 1) + │ └── @ LocalVariableTargetNode (location: (1,4)-(1,9)) + │ ├── name: :match + │ └── depth: 0 └── @ LocalVariableReadNode (location: (1,26)-(1,31)) ├── name: :match └── depth: 0 |