summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-09-12 20:48:28 -0400
committergit <svn-admin@ruby-lang.org>2023-09-13 13:50:13 +0000
commit90838a949053d7f240ddab2067b1dde8cca2ae7b (patch)
tree9a6f55b37766d88f08dd5eca27b0a18f886ed0fe /test
parentf9898b9ecab9851f32e1b3aad1176c801150f975 (diff)
[ruby/yarp] Fix associativity for a couple of operators
https://github.com/ruby/yarp/commit/820774976d
Diffstat (limited to 'test')
-rw-r--r--test/yarp/fixtures/arithmetic.txt1
-rw-r--r--test/yarp/snapshots/arithmetic.txt100
2 files changed, 78 insertions, 23 deletions
diff --git a/test/yarp/fixtures/arithmetic.txt b/test/yarp/fixtures/arithmetic.txt
index 6f86f92d47..47fa4ec24f 100644
--- a/test/yarp/fixtures/arithmetic.txt
+++ b/test/yarp/fixtures/arithmetic.txt
@@ -6,3 +6,4 @@ foo !bar
foo ~bar
+foo << bar << baz
diff --git a/test/yarp/snapshots/arithmetic.txt b/test/yarp/snapshots/arithmetic.txt
index 3a305e4bc3..7138973041 100644
--- a/test/yarp/snapshots/arithmetic.txt
+++ b/test/yarp/snapshots/arithmetic.txt
@@ -1,8 +1,8 @@
-@ ProgramNode (location: (0...39))
+@ ProgramNode (location: (0...58))
├── locals: []
└── statements:
- @ StatementsNode (location: (0...39))
- └── body: (length: 4)
+ @ StatementsNode (location: (0...58))
+ └── body: (length: 5)
├── @ CallNode (location: (0...8))
│ ├── receiver: ∅
│ ├── call_operator_loc: ∅
@@ -119,35 +119,89 @@
│ ├── block: ∅
│ ├── flags: ∅
│ └── name: "**"
- └── @ CallNode (location: (31...39))
- ├── receiver: ∅
+ ├── @ CallNode (location: (31...39))
+ │ ├── receiver: ∅
+ │ ├── call_operator_loc: ∅
+ │ ├── message_loc: (31...34) = "foo"
+ │ ├── opening_loc: ∅
+ │ ├── arguments:
+ │ │ @ ArgumentsNode (location: (35...39))
+ │ │ └── arguments: (length: 1)
+ │ │ └── @ CallNode (location: (35...39))
+ │ │ ├── receiver:
+ │ │ │ @ CallNode (location: (36...39))
+ │ │ │ ├── receiver: ∅
+ │ │ │ ├── call_operator_loc: ∅
+ │ │ │ ├── message_loc: (36...39) = "bar"
+ │ │ │ ├── opening_loc: ∅
+ │ │ │ ├── arguments: ∅
+ │ │ │ ├── closing_loc: ∅
+ │ │ │ ├── block: ∅
+ │ │ │ ├── flags: variable_call
+ │ │ │ └── name: "bar"
+ │ │ ├── call_operator_loc: ∅
+ │ │ ├── message_loc: (35...36) = "~"
+ │ │ ├── opening_loc: ∅
+ │ │ ├── arguments: ∅
+ │ │ ├── closing_loc: ∅
+ │ │ ├── block: ∅
+ │ │ ├── flags: ∅
+ │ │ └── name: "~"
+ │ ├── closing_loc: ∅
+ │ ├── block: ∅
+ │ ├── flags: ∅
+ │ └── name: "foo"
+ └── @ CallNode (location: (41...58))
+ ├── receiver:
+ │ @ CallNode (location: (41...51))
+ │ ├── receiver:
+ │ │ @ CallNode (location: (41...44))
+ │ │ ├── receiver: ∅
+ │ │ ├── call_operator_loc: ∅
+ │ │ ├── message_loc: (41...44) = "foo"
+ │ │ ├── opening_loc: ∅
+ │ │ ├── arguments: ∅
+ │ │ ├── closing_loc: ∅
+ │ │ ├── block: ∅
+ │ │ ├── flags: variable_call
+ │ │ └── name: "foo"
+ │ ├── call_operator_loc: ∅
+ │ ├── message_loc: (45...47) = "<<"
+ │ ├── opening_loc: ∅
+ │ ├── arguments:
+ │ │ @ ArgumentsNode (location: (48...51))
+ │ │ └── arguments: (length: 1)
+ │ │ └── @ CallNode (location: (48...51))
+ │ │ ├── receiver: ∅
+ │ │ ├── call_operator_loc: ∅
+ │ │ ├── message_loc: (48...51) = "bar"
+ │ │ ├── opening_loc: ∅
+ │ │ ├── arguments: ∅
+ │ │ ├── closing_loc: ∅
+ │ │ ├── block: ∅
+ │ │ ├── flags: variable_call
+ │ │ └── name: "bar"
+ │ ├── closing_loc: ∅
+ │ ├── block: ∅
+ │ ├── flags: ∅
+ │ └── name: "<<"
├── call_operator_loc: ∅
- ├── message_loc: (31...34) = "foo"
+ ├── message_loc: (52...54) = "<<"
├── opening_loc: ∅
├── arguments:
- │ @ ArgumentsNode (location: (35...39))
+ │ @ ArgumentsNode (location: (55...58))
│ └── arguments: (length: 1)
- │ └── @ CallNode (location: (35...39))
- │ ├── receiver:
- │ │ @ CallNode (location: (36...39))
- │ │ ├── receiver: ∅
- │ │ ├── call_operator_loc: ∅
- │ │ ├── message_loc: (36...39) = "bar"
- │ │ ├── opening_loc: ∅
- │ │ ├── arguments: ∅
- │ │ ├── closing_loc: ∅
- │ │ ├── block: ∅
- │ │ ├── flags: variable_call
- │ │ └── name: "bar"
+ │ └── @ CallNode (location: (55...58))
+ │ ├── receiver: ∅
│ ├── call_operator_loc: ∅
- │ ├── message_loc: (35...36) = "~"
+ │ ├── message_loc: (55...58) = "baz"
│ ├── opening_loc: ∅
│ ├── arguments: ∅
│ ├── closing_loc: ∅
│ ├── block: ∅
- │ ├── flags: ∅
- │ └── name: "~"
+ │ ├── flags: variable_call
+ │ └── name: "baz"
├── closing_loc: ∅
├── block: ∅
├── flags: ∅
- └── name: "foo"
+ └── name: "<<"