# YAML Test Matrix

--- &test-ZWK4
  Title: Key with anchor after missing explicit mapping value
  Tags: [ anchor, explicit-key, mapping ]

YAML

---
a: 1
? b
&anchor c: 3

Expected Events

+STR
+DOC ---
+MAP
=VAL :a
=VAL :1
=VAL :b
=VAL :
=VAL &anchor :c
=VAL :3
-MAP
-DOC
-STR

Expected JSON

{
"a": 1,
"b": null,
"c": 3
}

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

go-yaml-json

 json_ok

hs-hsyaml-json

 json_ok

js-jsyaml-json

 json_ok

js-yaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-xs-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

dotnet-yamldotnet-json

 json_diff
{
  "a": "1",
  "b": null,
  "c": "3"
}

lua-lyaml-json

 json_diff
{
  "a": 1,
  "b": {},
  "c": 3
}

perl-syck-json

 error
Syck parser (line 4, column 7): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

perl-syck-perl

 error
Syck parser (line 4, column 7): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

perl-yaml-json

 error
YAML Error: Invalid element in map
   Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
   Line: 4
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 360.

perl-yaml-perl

 error
YAML Error: Invalid element in map
   Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
   Line: 4
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 360.

hs-reference-yeast

 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|a
   2    1    5    5 -VAL |
   2    1    5    5 -NODE|
   2    1    5    5 =SYNX|:
   2    2    6    6 =WSPC|.
   2    3    7    7 +NODE|
   2    3    7    7 +VAL |
   2    3    7    7 =TEXT|1
   2    4    8    8 -VAL |
   2    4    8    8 -NODE|
   2    4    8    8 =EOL |\x0a
   3    0    9    9 -PAIR|
   3    0    9    9 +PAIR|
   3    0    9    9 =SYNX|?
   3    1   10   10 =WSPC|.
   3    2   11   11 +NODE|
   3    2   11   11 +VAL |
   3    2   11   11 =TEXT|b
   3    3   12   12 -VAL |
   3    3   12   12 -NODE|
   3    3   12   12 =EOL |\x0a
   4    0   13   13 +NODE|
   4    0   13   13 +VAL |
   4    0   13   13 -VAL |
   4    0   13   13 -NODE|
   4    0   13   13 -PAIR|
   4    0   13   13 +PAIR|
   4    0   13   13 +NODE|
   4    0   13   13 +PROP|
   4    0   13   13 +ANCH|
   4    0   13   13 =SYNX|&
   4    1   14   14 =META|anchor
   4    7   20   20 -ANCH|
   4    7   20   20 -PROP|
   4    7   20   20 =WSPC|.
   4    8   21   21 +VAL |
   4    8   21   21 =TEXT|c
   4    9   22   22 -VAL |
   4    9   22   22 -NODE|
   4    9   22   22 =SYNX|:
   4   10   23   23 =WSPC|.
   4   11   24   24 +NODE|
   4   11   24   24 +VAL |
   4   11   24   24 =TEXT|3
   4   12   25   25 -VAL |
   4   12   25   25 -NODE|
   4   12   25   25 =EOL |\x0a
   5    0   26   26 -PAIR|
   5    0   26   26 -MAP |
   5    0   26   26 -NODE|
   5    0   26   26 -DOC |

perl-pp-perl

 na
{
  'a' => 1,
  'b' => undef,
  'c' => 3
}

perl-pplibyaml-perl

 na
{
  'a' => 1,
  'b' => undef,
  'c' => 3
}

perl-xs-perl

 na
{
  'a' => 1,
  'b' => undef,
  'c' => 3
}

py-pyyaml-py

 na
{'a': 1, 'b': None, 'c': 3}

py-ruamel-py

 na
{'a': 1, 'b': None, 'c': 3}

perl-tiny-json

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

perl-tiny-perl

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