diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-09-19 11:46:04 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-09-20 18:30:34 +0000 |
commit | d6abca459f5c785aee0e77883710ec47fed1a98f (patch) | |
tree | 14ce234f5d6be906824075965adf110677b6a6ce /test/yarp/snapshots/lambda.txt | |
parent | 0a630fa461a7260235842e482f682deca30172d6 (diff) | |
download | ruby-d6abca459f5c785aee0e77883710ec47fed1a98f.tar.gz |
[ruby/yarp] Print locations using line / col instead of offsets
This commit changes printing of locations to use the format
(start_line,start_column)-(end_line,end_column) instead of using
offsets.
https://github.com/ruby/yarp/commit/c078696e22
Diffstat (limited to 'test/yarp/snapshots/lambda.txt')
-rw-r--r-- | test/yarp/snapshots/lambda.txt | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/test/yarp/snapshots/lambda.txt b/test/yarp/snapshots/lambda.txt index d7fc273768..ed622f6739 100644 --- a/test/yarp/snapshots/lambda.txt +++ b/test/yarp/snapshots/lambda.txt @@ -1,19 +1,19 @@ -@ ProgramNode (location: (0...92)) +@ ProgramNode (location: (1,0)-(11,18)) ├── locals: [] └── statements: - @ StatementsNode (location: (0...92)) + @ StatementsNode (location: (1,0)-(11,18)) └── body: (length: 5) - ├── @ LambdaNode (location: (0...14)) + ├── @ LambdaNode (location: (1,0)-(3,4)) │ ├── locals: [:foo] - │ ├── operator_loc: (0...2) = "->" - │ ├── opening_loc: (12...13) = "{" - │ ├── closing_loc: (13...14) = "}" + │ ├── operator_loc: (1,0)-(1,2) = "->" + │ ├── opening_loc: (3,2)-(3,3) = "{" + │ ├── closing_loc: (3,3)-(3,4) = "}" │ ├── parameters: - │ │ @ BlockParametersNode (location: (2...11)) + │ │ @ BlockParametersNode (location: (1,2)-(3,1)) │ │ ├── parameters: - │ │ │ @ ParametersNode (location: (6...9)) + │ │ │ @ ParametersNode (location: (2,2)-(2,5)) │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ RequiredParameterNode (location: (6...9)) + │ │ │ │ └── @ RequiredParameterNode (location: (2,2)-(2,5)) │ │ │ │ └── name: :foo │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ @@ -22,83 +22,83 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: ∅ │ │ ├── locals: (length: 0) - │ │ ├── opening_loc: (2...3) = "(" - │ │ └── closing_loc: (10...11) = ")" + │ │ ├── opening_loc: (1,2)-(1,3) = "(" + │ │ └── closing_loc: (3,0)-(3,1) = ")" │ └── body: ∅ - ├── @ LambdaNode (location: (16...34)) + ├── @ LambdaNode (location: (5,0)-(5,18)) │ ├── locals: [:x] - │ ├── operator_loc: (16...18) = "->" - │ ├── opening_loc: (31...32) = "{" - │ ├── closing_loc: (33...34) = "}" + │ ├── operator_loc: (5,0)-(5,2) = "->" + │ ├── opening_loc: (5,15)-(5,16) = "{" + │ ├── closing_loc: (5,17)-(5,18) = "}" │ ├── parameters: - │ │ @ BlockParametersNode (location: (18...30)) + │ │ @ BlockParametersNode (location: (5,2)-(5,14)) │ │ ├── parameters: - │ │ │ @ ParametersNode (location: (19...29)) + │ │ │ @ ParametersNode (location: (5,3)-(5,13)) │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 1) - │ │ │ │ └── @ KeywordParameterNode (location: (19...29)) + │ │ │ │ └── @ KeywordParameterNode (location: (5,3)-(5,13)) │ │ │ │ ├── name: :x - │ │ │ │ ├── name_loc: (19...21) = "x:" + │ │ │ │ ├── name_loc: (5,3)-(5,5) = "x:" │ │ │ │ └── value: - │ │ │ │ @ InterpolatedStringNode (location: (22...29)) - │ │ │ │ ├── opening_loc: (22...23) = "\"" + │ │ │ │ @ InterpolatedStringNode (location: (5,6)-(5,13)) + │ │ │ │ ├── opening_loc: (5,6)-(5,7) = "\"" │ │ │ │ ├── parts: (length: 2) - │ │ │ │ │ ├── @ StringNode (location: (23...24)) + │ │ │ │ │ ├── @ StringNode (location: (5,7)-(5,8)) │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ │ │ ├── content_loc: (23...24) = "b" + │ │ │ │ │ │ ├── content_loc: (5,7)-(5,8) = "b" │ │ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ │ │ └── unescaped: "b" - │ │ │ │ │ └── @ EmbeddedStatementsNode (location: (24...28)) - │ │ │ │ │ ├── opening_loc: (24...26) = "\#{" + │ │ │ │ │ └── @ EmbeddedStatementsNode (location: (5,8)-(5,12)) + │ │ │ │ │ ├── opening_loc: (5,8)-(5,10) = "\#{" │ │ │ │ │ ├── statements: - │ │ │ │ │ │ @ StatementsNode (location: (26...27)) + │ │ │ │ │ │ @ StatementsNode (location: (5,10)-(5,11)) │ │ │ │ │ │ └── body: (length: 1) - │ │ │ │ │ │ └── @ CallNode (location: (26...27)) + │ │ │ │ │ │ └── @ CallNode (location: (5,10)-(5,11)) │ │ │ │ │ │ ├── receiver: ∅ │ │ │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ │ │ ├── message_loc: (26...27) = "a" + │ │ │ │ │ │ ├── message_loc: (5,10)-(5,11) = "a" │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ │ │ ├── block: ∅ │ │ │ │ │ │ ├── flags: variable_call │ │ │ │ │ │ └── name: "a" - │ │ │ │ │ └── closing_loc: (27...28) = "}" - │ │ │ │ └── closing_loc: (28...29) = "\"" + │ │ │ │ │ └── closing_loc: (5,11)-(5,12) = "}" + │ │ │ │ └── closing_loc: (5,12)-(5,13) = "\"" │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: ∅ │ │ ├── locals: (length: 0) - │ │ ├── opening_loc: (18...19) = "(" - │ │ └── closing_loc: (29...30) = ")" + │ │ ├── opening_loc: (5,2)-(5,3) = "(" + │ │ └── closing_loc: (5,13)-(5,14) = ")" │ └── body: ∅ - ├── @ LambdaNode (location: (36...51)) + ├── @ LambdaNode (location: (7,0)-(7,15)) │ ├── locals: [:a] - │ ├── operator_loc: (36...38) = "->" - │ ├── opening_loc: (49...50) = "{" - │ ├── closing_loc: (50...51) = "}" + │ ├── operator_loc: (7,0)-(7,2) = "->" + │ ├── opening_loc: (7,13)-(7,14) = "{" + │ ├── closing_loc: (7,14)-(7,15) = "}" │ ├── parameters: - │ │ @ BlockParametersNode (location: (38...48)) + │ │ @ BlockParametersNode (location: (7,2)-(7,12)) │ │ ├── parameters: - │ │ │ @ ParametersNode (location: (39...47)) + │ │ │ @ ParametersNode (location: (7,3)-(7,11)) │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 0) │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) │ │ │ ├── keywords: (length: 1) - │ │ │ │ └── @ KeywordParameterNode (location: (39...47)) + │ │ │ │ └── @ KeywordParameterNode (location: (7,3)-(7,11)) │ │ │ │ ├── name: :a - │ │ │ │ ├── name_loc: (39...41) = "a:" + │ │ │ │ ├── name_loc: (7,3)-(7,5) = "a:" │ │ │ │ └── value: - │ │ │ │ @ CallNode (location: (42...47)) + │ │ │ │ @ CallNode (location: (7,6)-(7,11)) │ │ │ │ ├── receiver: - │ │ │ │ │ @ CallNode (location: (42...43)) + │ │ │ │ │ @ CallNode (location: (7,6)-(7,7)) │ │ │ │ │ ├── receiver: ∅ │ │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ │ ├── message_loc: (42...43) = "b" + │ │ │ │ │ ├── message_loc: (7,6)-(7,7) = "b" │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ @@ -106,12 +106,12 @@ │ │ │ │ │ ├── flags: variable_call │ │ │ │ │ └── name: "b" │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── message_loc: (44...45) = "*" + │ │ │ │ ├── message_loc: (7,8)-(7,9) = "*" │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: - │ │ │ │ │ @ ArgumentsNode (location: (46...47)) + │ │ │ │ │ @ ArgumentsNode (location: (7,10)-(7,11)) │ │ │ │ │ └── arguments: (length: 1) - │ │ │ │ │ └── @ IntegerNode (location: (46...47)) + │ │ │ │ │ └── @ IntegerNode (location: (7,10)-(7,11)) │ │ │ │ │ └── flags: decimal │ │ │ │ ├── closing_loc: ∅ │ │ │ │ ├── block: ∅ @@ -120,29 +120,29 @@ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: ∅ │ │ ├── locals: (length: 0) - │ │ ├── opening_loc: (38...39) = "(" - │ │ └── closing_loc: (47...48) = ")" + │ │ ├── opening_loc: (7,2)-(7,3) = "(" + │ │ └── closing_loc: (7,11)-(7,12) = ")" │ └── body: ∅ - ├── @ LambdaNode (location: (53...72)) + ├── @ LambdaNode (location: (9,0)-(9,19)) │ ├── locals: [:foo] - │ ├── operator_loc: (53...55) = "->" - │ ├── opening_loc: (66...68) = "do" - │ ├── closing_loc: (69...72) = "end" + │ ├── operator_loc: (9,0)-(9,2) = "->" + │ ├── opening_loc: (9,13)-(9,15) = "do" + │ ├── closing_loc: (9,16)-(9,19) = "end" │ ├── parameters: - │ │ @ BlockParametersNode (location: (56...65)) + │ │ @ BlockParametersNode (location: (9,3)-(9,12)) │ │ ├── parameters: - │ │ │ @ ParametersNode (location: (56...65)) + │ │ │ @ ParametersNode (location: (9,3)-(9,12)) │ │ │ ├── requireds: (length: 0) │ │ │ ├── optionals: (length: 1) - │ │ │ │ └── @ OptionalParameterNode (location: (56...65)) + │ │ │ │ └── @ OptionalParameterNode (location: (9,3)-(9,12)) │ │ │ │ ├── name: :foo - │ │ │ │ ├── name_loc: (56...59) = "foo" - │ │ │ │ ├── operator_loc: (60...61) = "=" + │ │ │ │ ├── name_loc: (9,3)-(9,6) = "foo" + │ │ │ │ ├── operator_loc: (9,7)-(9,8) = "=" │ │ │ │ └── value: - │ │ │ │ @ CallNode (location: (62...65)) + │ │ │ │ @ CallNode (location: (9,9)-(9,12)) │ │ │ │ ├── receiver: ∅ │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── message_loc: (62...65) = "bar" + │ │ │ │ ├── message_loc: (9,9)-(9,12) = "bar" │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ @@ -158,28 +158,28 @@ │ │ ├── opening_loc: ∅ │ │ └── closing_loc: ∅ │ └── body: ∅ - └── @ LambdaNode (location: (74...92)) + └── @ LambdaNode (location: (11,0)-(11,18)) ├── locals: [:foo] - ├── operator_loc: (74...76) = "->" - ├── opening_loc: (86...88) = "do" - ├── closing_loc: (89...92) = "end" + ├── operator_loc: (11,0)-(11,2) = "->" + ├── opening_loc: (11,12)-(11,14) = "do" + ├── closing_loc: (11,15)-(11,18) = "end" ├── parameters: - │ @ BlockParametersNode (location: (77...85)) + │ @ BlockParametersNode (location: (11,3)-(11,11)) │ ├── parameters: - │ │ @ ParametersNode (location: (77...85)) + │ │ @ ParametersNode (location: (11,3)-(11,11)) │ │ ├── requireds: (length: 0) │ │ ├── optionals: (length: 0) │ │ ├── rest: ∅ │ │ ├── posts: (length: 0) │ │ ├── keywords: (length: 1) - │ │ │ └── @ KeywordParameterNode (location: (77...85)) + │ │ │ └── @ KeywordParameterNode (location: (11,3)-(11,11)) │ │ │ ├── name: :foo - │ │ │ ├── name_loc: (77...81) = "foo:" + │ │ │ ├── name_loc: (11,3)-(11,7) = "foo:" │ │ │ └── value: - │ │ │ @ CallNode (location: (82...85)) + │ │ │ @ CallNode (location: (11,8)-(11,11)) │ │ │ ├── receiver: ∅ │ │ │ ├── call_operator_loc: ∅ - │ │ │ ├── message_loc: (82...85) = "bar" + │ │ │ ├── message_loc: (11,8)-(11,11) = "bar" │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ |