Commit 2a1aada
committed
Fix order for merging iterator
Consider the following YAML:
trait1: &t1
foo: 1
trait2: &t2
foo: 2
merged:
<<: *t1
<<: *t2
yq reports:
$ yq .merged.foo < /tmp/yaml
2
while the order that yaml-cpp returns is different, since it will
firstly handle 1, and will not replace it with 2:
$ util/parse < /tmp/yaml
trait1:
? &1 foo
: &2 1
trait2:
foo: 2
merged:
*1 : *2
(Don't mix up "*2" with "2", it is trait1)1 parent eef68f3 commit 2a1aada
2 files changed
+21
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
202 | 219 | | |
203 | 220 | | |
204 | 221 | | |
| |||
211 | 228 | | |
212 | 229 | | |
213 | 230 | | |
214 | | - | |
| 231 | + | |
215 | 232 | | |
216 | 233 | | |
217 | 234 | | |
| |||
0 commit comments