# YAML Test Matrix

--- &test-E76Z
  Title: Aliases in Implicit Block Mapping
  Tags: [ alias, mapping ]

YAML

&a a: &b b
*b : *a

Expected Events

+STR
+DOC
+MAP
=VAL &a :a
=VAL &b :b
=ALI *b
=ALI *a
-MAP
-DOC
-STR

Expected JSON

{
"a": "b",
"b": "a"
}

c-libfyaml-event

 ok

c-libyaml-event

 ok

cpp-rapidyaml-event

 ok

cpp-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

perl-refparser-event

 ok

py-pyyaml-event

 ok

py-ruamel-event

 ok

rust-yamlrust-event

 ok

c-libfyaml-json

 json_ok

dotnet-yamldotnet-json

 json_ok

go-yaml-json

 json_ok

hs-hsyaml-json

 json_ok

js-yaml-json

 json_ok

lua-lyaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-xs-json

 json_ok

perl-yaml-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

js-jsyaml-json

 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 b
---------^
 2 | *b : *a
    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 b\n*b : *a\n',
    position: 4,
    line: 0,
    column: 4,
    snippet: ' 1 | &a a: &b b\n---------^\n 2 | *b : *a'
  }
}

Node.js v20.13.1

perl-syck-json

 error
json text or perl structure exceeds maximum nesting level (max_depth set too low?) at /yaml/bin/perl-syck-json line 15.

hs-reference-yeast

 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 +PROP|
   1    6    6    6 +ANCH|
   1    6    6    6 =SYNX|&
   1    7    7    7 =META|b
   1    8    8    8 -ANCH|
   1    8    8    8 -PROP|
   1    8    8    8 =WSPC|.
   1    9    9    9 +VAL |
   1    9    9    9 =TEXT|b
   1   10   10   10 -VAL |
   1   10   10   10 -NODE|
   1   10   10   10 =EOL |\x0a
   2    0   11   11 -PAIR|
   2    0   11   11 +PAIR|
   2    0   11   11 +NODE|
   2    0   11   11 +ALI |
   2    0   11   11 =SYNX|*
   2    1   12   12 =META|b
   2    2   13   13 -ALI |
   2    2   13   13 -NODE|
   2    2   13   13 =WSPC|.
   2    3   14   14 =SYNX|:
   2    4   15   15 =WSPC|.
   2    5   16   16 +NODE|
   2    5   16   16 +ALI |
   2    5   16   16 =SYNX|*
   2    6   17   17 =META|a
   2    7   18   18 -ALI |
   2    7   18   18 -NODE|
   2    7   18   18 =EOL |\x0a
   3    0   19   19 -PAIR|
   3    0   19   19 -MAP |
   3    0   19   19 -NODE|
   3    0   19   19 -DOC |

perl-pp-perl

 na
{
  'a' => 'b',
  'b' => 'a'
}

perl-pplibyaml-perl

 na
{
  'a' => 'b',
  'b' => 'a'
}

perl-syck-perl

 na
{
  'a' => 'b',
  'b' => $VAR1
}

perl-xs-perl

 na
{
  'a' => 'b',
  'b' => 'a'
}

perl-yaml-perl

 na
{
  'a' => 'b',
  'b' => 'a'
}

py-pyyaml-py

 na
{'a': 'b', 'b': 'a'}

py-ruamel-py

 na
{'a': 'b', 'b': 'a'}

perl-tiny-json

 ni
YAML::Tiny does not support a feature in line '&b b' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny does not support a feature in line '&b b' at /yaml/bin/perl-tiny-perl line 15.