--- &test-U3XV
Title: Node and Mapping Key Anchors
Tags: [ 1.3-err, anchor, comment ]
---
top1: &node1
&k1 key1: one
top2: &node2 # comment
key2: two
top3:
&k3 key3: three
top4:
&node4
&k4 key4: four
top5:
&node5
key5: five
top6: &val6
six
top7:
&val7 seven
+STR
+DOC ---
+MAP
=VAL :top1
+MAP &node1
=VAL &k1 :key1
=VAL :one
-MAP
=VAL :top2
+MAP &node2
=VAL :key2
=VAL :two
-MAP
=VAL :top3
+MAP
=VAL &k3 :key3
=VAL :three
-MAP
=VAL :top4
+MAP &node4
=VAL &k4 :key4
=VAL :four
-MAP
=VAL :top5
+MAP &node5
=VAL :key5
=VAL :five
-MAP
=VAL :top6
=VAL &val6 :six
=VAL :top7
=VAL &val7 :seven
-MAP
-DOC
-STR
{
"top1": {
"key1": "one"
},
"top2": {
"key2": "two"
},
"top3": {
"key3": "three"
},
"top4": {
"key4": "four"
},
"top5": {
"key5": "five"
},
"top6": "six",
"top7": "seven"
}
error
/node/node_modules/js-yaml/lib/loader.js:187
throw generateError(state, message);
^
YAMLException: duplication of an anchor property (3:3)
1 | ---
2 | top1: &node1
3 | &k1 key1: one
-------^
4 | top2: &node2 # comment
5 | key2: two
at generateError (/node/node_modules/js-yaml/lib/loader.js:183:10)
at throwError (/node/node_modules/js-yaml/lib/loader.js:187:9)
at readAnchorProperty (/node/node_modules/js-yaml/lib/loader.js:1317:5)
at composeNode (/node/node_modules/js-yaml/lib/loader.js:1407:38)
at readBlockMapping (/node/node_modules/js-yaml/lib/loader.js:1164:11)
at composeNode (/node/node_modules/js-yaml/lib/loader.js:1441:12)
at readDocument (/node/node_modules/js-yaml/lib/loader.js:1625:3)
at loadDocuments (/node/node_modules/js-yaml/lib/loader.js:1688:5)
at Object.loadAll (/node/node_modules/js-yaml/lib/loader.js:1701:19)
at Object.<anonymous> (/yaml/bin/js-jsyaml-json:7:13) {
reason: 'duplication of an anchor property',
mark: {
name: null,
buffer: '---\n' +
'top1: &node1\n' +
' &k1 key1: one\n' +
'top2: &node2 # comment\n' +
' key2: two\n' +
'top3:\n' +
' &k3 key3: three\n' +
'top4:\n' +
' &node4\n' +
' &k4 key4: four\n' +
'top5:\n' +
' &node5\n' +
' key5: five\n' +
'top6: &val6\n' +
' six\n' +
'top7:\n' +
' &val7 seven\n',
position: 19,
line: 2,
column: 2,
snippet: ' 1 | ---\n' +
' 2 | top1: &node1\n' +
' 3 | &k1 key1: one\n' +
'-------^\n' +
' 4 | top2: &node2 # comment\n' +
' 5 | key2: two'
}
}
Node.js v20.13.1
error
YAML Error: Inconsistent indentation level
Code: YAML_PARSE_ERR_INCONSISTENT_INDENTATION
Line: 5
Document: 1
at /perl5/lib/perl5/YAML/Loader.pm line 804.
error
YAML Error: Inconsistent indentation level
Code: YAML_PARSE_ERR_INCONSISTENT_INDENTATION
Line: 5
Document: 1
at /perl5/lib/perl5/YAML/Loader.pm line 804.
na
Line Col Char Byte Token|Content
1 0 0 0 +DOC |
1 0 0 0 =HEAD|---
1 3 3 3 +NODE|
1 3 3 3 =EOL |\x0a
2 0 4 4 +MAP |
2 0 4 4 +PAIR|
2 0 4 4 +NODE|
2 0 4 4 +VAL |
2 0 4 4 =TEXT|top1
2 4 8 8 -VAL |
2 4 8 8 -NODE|
2 4 8 8 =SYNX|:
2 5 9 9 +NODE|
2 5 9 9 =WSPC|.
2 6 10 10 +PROP|
2 6 10 10 +ANCH|
2 6 10 10 =SYNX|&
2 7 11 11 =META|node1
2 12 16 16 -ANCH|
2 12 16 16 -PROP|
2 12 16 16 =EOL |\x0a
3 0 17 17 +MAP |
3 0 17 17 =DENT|..
3 2 19 19 +PAIR|
3 2 19 19 +NODE|
3 2 19 19 +PROP|
3 2 19 19 +ANCH|
3 2 19 19 =SYNX|&
3 3 20 20 =META|k1
3 5 22 22 -ANCH|
3 5 22 22 -PROP|
3 5 22 22 =WSPC|.
3 6 23 23 +VAL |
3 6 23 23 =TEXT|key1
3 10 27 27 -VAL |
3 10 27 27 -NODE|
3 10 27 27 =SYNX|:
3 11 28 28 =WSPC|.
3 12 29 29 +NODE|
3 12 29 29 +VAL |
3 12 29 29 =TEXT|one
3 15 32 32 -VAL |
3 15 32 32 -NODE|
3 15 32 32 =EOL |\x0a
4 0 33 33 -PAIR|
4 0 33 33 -MAP |
4 0 33 33 -NODE|
4 0 33 33 -PAIR|
4 0 33 33 +PAIR|
4 0 33 33 +NODE|
4 0 33 33 +VAL |
4 0 33 33 =TEXT|top2
4 4 37 37 -VAL |
4 4 37 37 -NODE|
4 4 37 37 =SYNX|:
4 5 38 38 +NODE|
4 5 38 38 =WSPC|.
4 6 39 39 +PROP|
4 6 39 39 +ANCH|
4 6 39 39 =SYNX|&
4 7 40 40 =META|node2
4 12 45 45 -ANCH|
4 12 45 45 -PROP|
4 12 45 45 =WSPC|.
4 13 46 46 +COMM|
4 13 46 46 =SYNX|#
4 14 47 47 =META|.comment
4 22 55 55 -COMM|
4 22 55 55 =EOL |\x0a
5 0 56 56 +MAP |
5 0 56 56 =DENT|..
5 2 58 58 +PAIR|
5 2 58 58 +NODE|
5 2 58 58 +VAL |
5 2 58 58 =TEXT|key2
5 6 62 62 -VAL |
5 6 62 62 -NODE|
5 6 62 62 =SYNX|:
5 7 63 63 =WSPC|.
5 8 64 64 +NODE|
5 8 64 64 +VAL |
5 8 64 64 =TEXT|two
5 11 67 67 -VAL |
5 11 67 67 -NODE|
5 11 67 67 =EOL |\x0a
6 0 68 68 -PAIR|
6 0 68 68 -MAP |
6 0 68 68 -NODE|
6 0 68 68 -PAIR|
6 0 68 68 +PAIR|
6 0 68 68 +NODE|
6 0 68 68 +VAL |
6 0 68 68 =TEXT|top3
6 4 72 72 -VAL |
6 4 72 72 -NODE|
6 4 72 72 =SYNX|:
6 5 73 73 +NODE|
6 5 73 73 =EOL |\x0a
7 0 74 74 +MAP |
7 0 74 74 =DENT|..
7 2 76 76 +PAIR|
7 2 76 76 +NODE|
7 2 76 76 +PROP|
7 2 76 76 +ANCH|
7 2 76 76 =SYNX|&
7 3 77 77 =META|k3
7 5 79 79 -ANCH|
7 5 79 79 -PROP|
7 5 79 79 =WSPC|.
7 6 80 80 +VAL |
7 6 80 80 =TEXT|key3
7 10 84 84 -VAL |
7 10 84 84 -NODE|
7 10 84 84 =SYNX|:
7 11 85 85 =WSPC|.
7 12 86 86 +NODE|
7 12 86 86 +VAL |
7 12 86 86 =TEXT|three
7 17 91 91 -VAL |
7 17 91 91 -NODE|
7 17 91 91 =EOL |\x0a
8 0 92 92 -PAIR|
8 0 92 92 -MAP |
8 0 92 92 -NODE|
8 0 92 92 -PAIR|
8 0 92 92 +PAIR|
8 0 92 92 +NODE|
8 0 92 92 +VAL |
8 0 92 92 =TEXT|top4
8 4 96 96 -VAL |
8 4 96 96 -NODE|
8 4 96 96 =SYNX|:
8 5 97 97 +NODE|
8 5 97 97 =EOL |\x0a
9 0 98 98 =DENT|.
9 1 99 99 =WSPC|.
9 2 100 100 +PROP|
9 2 100 100 +ANCH|
9 2 100 100 =SYNX|&
9 3 101 101 =META|node4
9 8 106 106 -ANCH|
9 8 106 106 -PROP|
9 8 106 106 =EOL |\x0a
10 0 107 107 +MAP |
10 0 107 107 =DENT|..
10 2 109 109 +PAIR|
10 2 109 109 +NODE|
10 2 109 109 +PROP|
10 2 109 109 +ANCH|
10 2 109 109 =SYNX|&
10 3 110 110 =META|k4
10 5 112 112 -ANCH|
10 5 112 112 -PROP|
10 5 112 112 =WSPC|.
10 6 113 113 +VAL |
10 6 113 113 =TEXT|key4
10 10 117 117 -VAL |
10 10 117 117 -NODE|
10 10 117 117 =SYNX|:
10 11 118 118 =WSPC|.
10 12 119 119 +NODE|
10 12 119 119 +VAL |
10 12 119 119 =TEXT|four
10 16 123 123 -VAL |
10 16 123 123 -NODE|
10 16 123 123 =EOL |\x0a
11 0 124 124 -PAIR|
11 0 124 124 -MAP |
11 0 124 124 -NODE|
11 0 124 124 -PAIR|
11 0 124 124 +PAIR|
11 0 124 124 +NODE|
11 0 124 124 +VAL |
11 0 124 124 =TEXT|top5
11 4 128 128 -VAL |
11 4 128 128 -NODE|
11 4 128 128 =SYNX|:
11 5 129 129 +NODE|
11 5 129 129 =EOL |\x0a
12 0 130 130 =DENT|.
12 1 131 131 =WSPC|.
12 2 132 132 +PROP|
12 2 132 132 +ANCH|
12 2 132 132 =SYNX|&
12 3 133 133 =META|node5
12 8 138 138 -ANCH|
12 8 138 138 -PROP|
12 8 138 138 =EOL |\x0a
13 0 139 139 +MAP |
13 0 139 139 =DENT|..
13 2 141 141 +PAIR|
13 2 141 141 +NODE|
13 2 141 141 +VAL |
13 2 141 141 =TEXT|key5
13 6 145 145 -VAL |
13 6 145 145 -NODE|
13 6 145 145 =SYNX|:
13 7 146 146 =WSPC|.
13 8 147 147 +NODE|
13 8 147 147 +VAL |
----- 8< -----
na
{
'top1' => {
'key1' => 'one'
},
'top2' => {
'key2' => 'two'
},
'top3' => {
'key3' => 'three'
},
'top4' => {
'key4' => 'four'
},
'top5' => {
'key5' => 'five'
},
'top6' => 'six',
'top7' => 'seven'
}
na
{
'top1' => {
'key1' => 'one'
},
'top2' => {
'key2' => 'two'
},
'top3' => {
'key3' => 'three'
},
'top4' => {
'key4' => 'four'
},
'top5' => {
'key5' => 'five'
},
'top6' => 'six',
'top7' => 'seven'
}
na
{
'top1' => {
'key1' => 'one'
},
'top2' => {
'key2' => 'two'
},
'top3' => {
'key3' => 'three'
},
'top4' => {
'key4' => 'four'
},
'top5' => {
'key5' => 'five'
},
'top6' => 'six',
'top7' => 'seven'
}
na
{
'top1' => {
'key1' => 'one'
},
'top2' => {
'key2' => 'two'
},
'top3' => {
'key3' => 'three'
},
'top4' => {
'key4' => 'four'
},
'top5' => {
'key5' => 'five'
},
'top6' => 'six',
'top7' => 'seven'
}
na
{'top1': {'key1': 'one'},
'top2': {'key2': 'two'},
'top3': {'key3': 'three'},
'top4': {'key4': 'four'},
'top5': {'key5': 'five'},
'top6': 'six',
'top7': 'seven'}
na
{'top1': {'key1': 'one'},
'top2': {'key2': 'two'},
'top3': {'key3': 'three'},
'top4': {'key4': 'four'},
'top5': {'key5': 'five'},
'top6': 'six',
'top7': 'seven'}
ni
YAML::Tiny does not support a feature in line '&node1' at /yaml/bin/perl-tiny-json line 12.
ni
YAML::Tiny does not support a feature in line '&node1' at /yaml/bin/perl-tiny-perl line 15.