# YAML Test Matrix

--- &test-F2C7
  Title: Anchors and Tags
  Tags: [ anchor, tag ]

YAML

 - &a !!str a
 - !!int 2
 - !!int &c 4
 - &d d

Expected Events

+STR
+DOC
+SEQ
=VAL &a <tag:yaml.org,2002:str> :a
=VAL <tag:yaml.org,2002:int> :2
=VAL &c <tag:yaml.org,2002:int> :4
=VAL &d :d
-SEQ
-DOC
-STR

Expected JSON

[
"a",
2,
4,
"d"
]

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-jsyaml-json

 json_ok

js-yaml-json

 json_ok

lua-lyaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-syck-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

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 +NODE|
   1    0    0    0 +SEQ |
   1    0    0    0 =DENT|.
   1    1    1    1 =SYNX|-
   1    2    2    2 =WSPC|.
   1    3    3    3 +NODE|
   1    3    3    3 +PROP|
   1    3    3    3 +ANCH|
   1    3    3    3 =SYNX|&
   1    4    4    4 =META|a
   1    5    5    5 -ANCH|
   1    5    5    5 =WSPC|.
   1    6    6    6 +TAG |
   1    6    6    6 +HAND|
   1    6    6    6 =SYNX|!
   1    7    7    7 =SYNX|!
   1    8    8    8 -HAND|
   1    8    8    8 =META|str
   1   11   11   11 -TAG |
   1   11   11   11 -PROP|
   1   11   11   11 =WSPC|.
   1   12   12   12 +VAL |
   1   12   12   12 =TEXT|a
   1   13   13   13 -VAL |
   1   13   13   13 -NODE|
   1   13   13   13 =EOL |\x0a
   2    0   14   14 =DENT|.
   2    1   15   15 =SYNX|-
   2    2   16   16 =WSPC|.
   2    3   17   17 +NODE|
   2    3   17   17 +PROP|
   2    3   17   17 +TAG |
   2    3   17   17 +HAND|
   2    3   17   17 =SYNX|!
   2    4   18   18 =SYNX|!
   2    5   19   19 -HAND|
   2    5   19   19 =META|int
   2    8   22   22 -TAG |
   2    8   22   22 -PROP|
   2    8   22   22 =WSPC|.
   2    9   23   23 +VAL |
   2    9   23   23 =TEXT|2
   2   10   24   24 -VAL |
   2   10   24   24 -NODE|
   2   10   24   24 =EOL |\x0a
   3    0   25   25 =DENT|.
   3    1   26   26 =SYNX|-
   3    2   27   27 =WSPC|.
   3    3   28   28 +NODE|
   3    3   28   28 +PROP|
   3    3   28   28 +TAG |
   3    3   28   28 +HAND|
   3    3   28   28 =SYNX|!
   3    4   29   29 =SYNX|!
   3    5   30   30 -HAND|
   3    5   30   30 =META|int
   3    8   33   33 -TAG |
   3    8   33   33 =WSPC|.
   3    9   34   34 +ANCH|
   3    9   34   34 =SYNX|&
   3   10   35   35 =META|c
   3   11   36   36 -ANCH|
   3   11   36   36 -PROP|
   3   11   36   36 =WSPC|.
   3   12   37   37 +VAL |
   3   12   37   37 =TEXT|4
   3   13   38   38 -VAL |
   3   13   38   38 -NODE|
   3   13   38   38 =EOL |\x0a
   4    0   39   39 =DENT|.
   4    1   40   40 =SYNX|-
   4    2   41   41 =WSPC|.
   4    3   42   42 +NODE|
   4    3   42   42 +PROP|
   4    3   42   42 +ANCH|
   4    3   42   42 =SYNX|&
   4    4   43   43 =META|d
   4    5   44   44 -ANCH|
   4    5   44   44 -PROP|
   4    5   44   44 =WSPC|.
   4    6   45   45 +VAL |
   4    6   45   45 =TEXT|d
   4    7   46   46 -VAL |
   4    7   46   46 -NODE|
   4    7   46   46 =EOL |\x0a
   5    0   47   47 -SEQ |
   5    0   47   47 -NODE|
   5    0   47   47 -DOC |

perl-pp-perl

 na
[
  'a',
  2,
  4,
  'd'
]

perl-pplibyaml-perl

 na
[
  'a',
  2,
  4,
  'd'
]

perl-syck-perl

 na
[
  'a',
  2,
  4,
  'd'
]

perl-xs-perl

 na
[
  'a',
  2,
  4,
  'd'
]

perl-yaml-perl

 na
[
  'a',
  2,
  4,
  'd'
]

py-pyyaml-py

 na
['a', 2, 4, 'd']

py-ruamel-py

 na
['a', 2, 4, 'd']

perl-tiny-json

 ni
YAML::Tiny found bad indenting in line ' - &a !!str a' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny found bad indenting in line ' - &a !!str a' at /yaml/bin/perl-tiny-perl line 15.