diff options
author | Kevin Newton <[email protected]> | 2024-07-02 14:27:04 -0400 |
---|---|---|
committer | Kevin Newton <[email protected]> | 2024-07-11 14:25:54 -0400 |
commit | ca48fb76fb0669ca0666a7aa129e1f5d2b7468da (patch) | |
tree | fce04cbe37f6976af6824f885a6032f66df7d470 /test | |
parent | 678dd769e560db9cebff41218e3413e6688aaf12 (diff) |
[ruby/prism] Move location to second position for node initializers
https://github.com/ruby/prism/commit/4cc0eda4ca
Diffstat (limited to 'test')
-rw-r--r-- | test/prism/errors/content_after_unterminated_heredoc.txt | 2 | ||||
-rw-r--r-- | test/prism/snapshots/patterns.txt | 144 |
2 files changed, 118 insertions, 28 deletions
diff --git a/test/prism/errors/content_after_unterminated_heredoc.txt b/test/prism/errors/content_after_unterminated_heredoc.txt index 43815cd9d0..c0446a8c39 100644 --- a/test/prism/errors/content_after_unterminated_heredoc.txt +++ b/test/prism/errors/content_after_unterminated_heredoc.txt @@ -1,2 +1,4 @@ <<~FOO.foo ^~~ unterminated heredoc; can't find string "FOO" anywhere before EOF + ^~~ unterminated heredoc; can't find string "FOO" anywhere before EOF + diff --git a/test/prism/snapshots/patterns.txt b/test/prism/snapshots/patterns.txt index 17aa23b4b9..51026972e1 100644 --- a/test/prism/snapshots/patterns.txt +++ b/test/prism/snapshots/patterns.txt @@ -1,8 +1,8 @@ -@ ProgramNode (location: (1,0)-(217,5)) -├── locals: [:bar, :baz, :qux, :b, :a, :foo, :x] +@ ProgramNode (location: (1,0)-(220,31)) +├── locals: [:bar, :baz, :qux, :b, :a, :foo, :x, :_a] └── statements: - @ StatementsNode (location: (1,0)-(217,5)) - └── body: (length: 180) + @ StatementsNode (location: (1,0)-(220,31)) + └── body: (length: 182) ├── @ MatchRequiredNode (location: (1,0)-(1,10)) │ ├── value: │ │ @ CallNode (location: (1,0)-(1,3)) @@ -4883,27 +4883,115 @@ │ │ └── operator_loc: (212,11)-(212,13) = "in" │ ├── opening_loc: (212,7)-(212,8) = "{" │ └── closing_loc: (212,18)-(212,19) = "}" - └── @ MultiWriteNode (location: (214,0)-(217,5)) - ├── lefts: (length: 2) - │ ├── @ LocalVariableTargetNode (location: (215,2)-(215,3)) - │ │ ├── name: :a - │ │ └── depth: 0 - │ └── @ LocalVariableTargetNode (location: (216,2)-(216,3)) - │ ├── name: :b - │ └── depth: 0 - ├── rest: ∅ - ├── rights: (length: 0) - ├── lparen_loc: (214,0)-(214,1) = "(" - ├── rparen_loc: (217,0)-(217,1) = ")" - ├── operator_loc: (217,2)-(217,3) = "=" - └── value: - @ CallNode (location: (217,4)-(217,5)) - ├── flags: variable_call, ignore_visibility - ├── receiver: ∅ - ├── call_operator_loc: ∅ - ├── name: :c - ├── message_loc: (217,4)-(217,5) = "c" - ├── opening_loc: ∅ - ├── arguments: ∅ - ├── closing_loc: ∅ - └── block: ∅ + ├── @ MultiWriteNode (location: (214,0)-(217,5)) + │ ├── lefts: (length: 2) + │ │ ├── @ LocalVariableTargetNode (location: (215,2)-(215,3)) + │ │ │ ├── name: :a + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableTargetNode (location: (216,2)-(216,3)) + │ │ ├── name: :b + │ │ └── depth: 0 + │ ├── rest: ∅ + │ ├── rights: (length: 0) + │ ├── lparen_loc: (214,0)-(214,1) = "(" + │ ├── rparen_loc: (217,0)-(217,1) = ")" + │ ├── operator_loc: (217,2)-(217,3) = "=" + │ └── value: + │ @ CallNode (location: (217,4)-(217,5)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :c + │ ├── message_loc: (217,4)-(217,5) = "c" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CaseMatchNode (location: (219,0)-(219,25)) + │ ├── predicate: + │ │ @ ParenthesesNode (location: (219,5)-(219,7)) + │ │ ├── body: ∅ + │ │ ├── opening_loc: (219,5)-(219,6) = "(" + │ │ └── closing_loc: (219,6)-(219,7) = ")" + │ ├── conditions: (length: 1) + │ │ └── @ InNode (location: (219,9)-(219,20)) + │ │ ├── pattern: + │ │ │ @ ArrayPatternNode (location: (219,12)-(219,20)) + │ │ │ ├── constant: ∅ + │ │ │ ├── requireds: (length: 2) + │ │ │ │ ├── @ LocalVariableTargetNode (location: (219,13)-(219,15)) + │ │ │ │ │ ├── name: :_a + │ │ │ │ │ └── depth: 0 + │ │ │ │ └── @ LocalVariableTargetNode (location: (219,17)-(219,19)) + │ │ │ │ ├── name: :_a + │ │ │ │ └── depth: 0 + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── opening_loc: (219,12)-(219,13) = "[" + │ │ │ └── closing_loc: (219,19)-(219,20) = "]" + │ │ ├── statements: ∅ + │ │ ├── in_loc: (219,9)-(219,11) = "in" + │ │ └── then_loc: ∅ + │ ├── consequent: ∅ + │ ├── case_keyword_loc: (219,0)-(219,4) = "case" + │ └── end_keyword_loc: (219,22)-(219,25) = "end" + └── @ CaseMatchNode (location: (220,0)-(220,31)) + ├── predicate: + │ @ ParenthesesNode (location: (220,5)-(220,7)) + │ ├── body: ∅ + │ ├── opening_loc: (220,5)-(220,6) = "(" + │ └── closing_loc: (220,6)-(220,7) = ")" + ├── conditions: (length: 1) + │ └── @ InNode (location: (220,9)-(220,26)) + │ ├── pattern: + │ │ @ ArrayPatternNode (location: (220,12)-(220,26)) + │ │ ├── constant: ∅ + │ │ ├── requireds: (length: 2) + │ │ │ ├── @ HashPatternNode (location: (220,13)-(220,18)) + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── elements: (length: 1) + │ │ │ │ │ └── @ AssocNode (location: (220,14)-(220,17)) + │ │ │ │ │ ├── key: + │ │ │ │ │ │ @ SymbolNode (location: (220,14)-(220,16)) + │ │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── value_loc: (220,14)-(220,15) = "a" + │ │ │ │ │ │ ├── closing_loc: (220,15)-(220,16) = ":" + │ │ │ │ │ │ └── unescaped: "a" + │ │ │ │ │ ├── value: + │ │ │ │ │ │ @ IntegerNode (location: (220,16)-(220,17)) + │ │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ │ └── value: 1 + │ │ │ │ │ └── operator_loc: ∅ + │ │ │ │ ├── rest: ∅ + │ │ │ │ ├── opening_loc: (220,13)-(220,14) = "{" + │ │ │ │ └── closing_loc: (220,17)-(220,18) = "}" + │ │ │ └── @ HashPatternNode (location: (220,20)-(220,25)) + │ │ │ ├── constant: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ AssocNode (location: (220,21)-(220,24)) + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (220,21)-(220,23)) + │ │ │ │ │ ├── flags: forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (220,21)-(220,22) = "a" + │ │ │ │ │ ├── closing_loc: (220,22)-(220,23) = ":" + │ │ │ │ │ └── unescaped: "a" + │ │ │ │ ├── value: + │ │ │ │ │ @ IntegerNode (location: (220,23)-(220,24)) + │ │ │ │ │ ├── flags: decimal + │ │ │ │ │ └── value: 2 + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── rest: ∅ + │ │ │ ├── opening_loc: (220,20)-(220,21) = "{" + │ │ │ └── closing_loc: (220,24)-(220,25) = "}" + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── opening_loc: (220,12)-(220,13) = "[" + │ │ └── closing_loc: (220,25)-(220,26) = "]" + │ ├── statements: ∅ + │ ├── in_loc: (220,9)-(220,11) = "in" + │ └── then_loc: ∅ + ├── consequent: ∅ + ├── case_keyword_loc: (220,0)-(220,4) = "case" + └── end_keyword_loc: (220,28)-(220,31) = "end" |