--- &test-ZH7C
Title: Anchors in Mapping
Tags: [ anchor, mapping ]
+STR
+DOC
+MAP
=VAL &a :a
=VAL :b
=VAL :c
=VAL &d :d
-MAP
-DOC
-STR
error
/node/node_modules/js-yaml/lib/loader.js:187
throw generateError(state, message);
^
YAMLException: end of the stream or a document separator is expected (1:5)
1 | &a a: b
---------^
2 | c: &d d
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 readDocument (/node/node_modules/js-yaml/lib/loader.js:1645:5)
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)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12) {
reason: 'end of the stream or a document separator is expected',
mark: {
name: null,
buffer: '&a a: b\nc: &d d\n',
position: 4,
line: 0,
column: 4,
snippet: ' 1 | &a a: b\n---------^\n 2 | c: &d d'
}
}
Node.js v20.13.1
na
Line Col Char Byte Token|Content
1 0 0 0 +DOC |
1 0 0 0 +NODE|
1 0 0 0 +MAP |
1 0 0 0 +PAIR|
1 0 0 0 +NODE|
1 0 0 0 +PROP|
1 0 0 0 +ANCH|
1 0 0 0 =SYNX|&
1 1 1 1 =META|a
1 2 2 2 -ANCH|
1 2 2 2 -PROP|
1 2 2 2 =WSPC|.
1 3 3 3 +VAL |
1 3 3 3 =TEXT|a
1 4 4 4 -VAL |
1 4 4 4 -NODE|
1 4 4 4 =SYNX|:
1 5 5 5 =WSPC|.
1 6 6 6 +NODE|
1 6 6 6 +VAL |
1 6 6 6 =TEXT|b
1 7 7 7 -VAL |
1 7 7 7 -NODE|
1 7 7 7 =EOL |\x0a
2 0 8 8 -PAIR|
2 0 8 8 +PAIR|
2 0 8 8 +NODE|
2 0 8 8 +VAL |
2 0 8 8 =TEXT|c
2 1 9 9 -VAL |
2 1 9 9 -NODE|
2 1 9 9 =SYNX|:
2 2 10 10 =WSPC|.
2 3 11 11 +NODE|
2 3 11 11 +PROP|
2 3 11 11 +ANCH|
2 3 11 11 =SYNX|&
2 4 12 12 =META|d
2 5 13 13 -ANCH|
2 5 13 13 -PROP|
2 5 13 13 =WSPC|.
2 6 14 14 +VAL |
2 6 14 14 =TEXT|d
2 7 15 15 -VAL |
2 7 15 15 -NODE|
2 7 15 15 =EOL |\x0a
3 0 16 16 -PAIR|
3 0 16 16 -MAP |
3 0 16 16 -NODE|
3 0 16 16 -DOC |
na
{
'a' => 'b',
'c' => 'd'
}
na
{
'a' => 'b',
'c' => 'd'
}
na
{
'a' => 'b',
'c' => 'd'
}
na
{
'a' => 'b',
'c' => 'd'
}
na
{
'a' => 'b',
'c' => 'd'
}
ni
YAML::Tiny does not support a feature in line '&d d' at /yaml/bin/perl-tiny-json line 12.
ni
YAML::Tiny does not support a feature in line '&d d' at /yaml/bin/perl-tiny-perl line 15.