# YAML Test Matrix

--- &test-DC7X
  Title: Various trailing tabs
  Tags: [ comment, whitespace ]

YAML

a: b	
seq:	
 - a	
c: d	#X

Expected Events

+STR
+DOC
+MAP
=VAL :a
=VAL :b
=VAL :seq
+SEQ
=VAL :a
-SEQ
=VAL :c
=VAL :d
-MAP
-DOC
-STR

Expected JSON

{
"a": "b",
"c": "d",
"seq": [
"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

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

 json_ok

perl-xs-json

 json_ok

perl-yaml-json

 json_ok

ruby-psych-json

 json_ok

perl-syck-json

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

py-pyyaml-event

 error
+STR
+DOC
+MAP
=VAL :a
=VAL :b
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-event", line 7, in <module>
    for event in yaml.parse(sys.stdin.read()):
  File "/python/lib/python3.12/site-packages/yaml/__init__.py", line 75, in parse
    while loader.check_event():
          ^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 428, in parse_block_mapping_key
    if self.check_token(KeyToken):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.12/site-packages/yaml/scanner.py", line 258, in fetch_more_tokens
    raise ScannerError("while scanning for the next token", None,
yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
  in "<unicode string>", line 1, column 5:
    a: b	
        ^

py-pyyaml-json

 error
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-json", line 19, in <module>
    for doc in yaml.load_all(sys.stdin.read(), Loader=yaml.FullLoader):
  File "/python/lib/python3.12/site-packages/yaml/__init__.py", line 130, in load_all
    yield loader.get_data()
          ^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/constructor.py", line 45, in get_data
    return self.construct_document(self.get_node())
                                   ^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 27, in get_node
    return self.compose_document()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 428, in parse_block_mapping_key
    if self.check_token(KeyToken):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.12/site-packages/yaml/scanner.py", line 258, in fetch_more_tokens
    raise ScannerError("while scanning for the next token", None,
yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
  in "<unicode string>", line 1, column 5:
    a: b	
        ^

py-pyyaml-py

 error
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-py", line 36, in <module>
    for doc in yaml.load_all(sys.stdin.read(), Loader=yaml.FullLoader):
  File "/python/lib/python3.12/site-packages/yaml/__init__.py", line 130, in load_all
    yield loader.get_data()
          ^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/constructor.py", line 45, in get_data
    return self.construct_document(self.get_node())
                                   ^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 27, in get_node
    return self.compose_document()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 428, in parse_block_mapping_key
    if self.check_token(KeyToken):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.12/site-packages/yaml/scanner.py", line 258, in fetch_more_tokens
    raise ScannerError("while scanning for the next token", None,
yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
  in "<unicode string>", line 1, column 5:
    a: b	
        ^

py-ruamel-event

 error
+STR
+DOC
+MAP
=VAL :a
=VAL :b
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-event", line 9, in <module>
    for event in yaml.parse(sys.stdin.read()):
  File "/python/lib/python3.12/site-packages/ruamel/yaml/main.py", line 371, in parse
    while parser.check_event():
          ^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 141, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 600, in parse_block_mapping_key
    if self.scanner.check_token(KeyToken):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 170, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 313, in fetch_more_tokens
    raise ScannerError(
ruamel.yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
  in "<unicode string>", line 1, column 5:
    a: b	
        ^ (line: 1)

py-ruamel-json

 error
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-json", line 21, in <module>
    for doc in yaml.load_all(sys.stdin.read()):
  File "/python/lib/python3.12/site-packages/ruamel/yaml/main.py", line 476, in load_all
    yield constructor.get_data()
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/constructor.py", line 110, in get_data
    return self.construct_document(self.composer.get_node())
                                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 63, in get_node
    return self.compose_document()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 94, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 130, in compose_node
    node = self.compose_mapping_node(anchor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 204, in compose_mapping_node
    while not self.parser.check_event(MappingEndEvent):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 141, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 600, in parse_block_mapping_key
    if self.scanner.check_token(KeyToken):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 170, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 313, in fetch_more_tokens
    raise ScannerError(
ruamel.yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
  in "<unicode string>", line 1, column 5:
    a: b	
        ^ (line: 1)

py-ruamel-py

 error
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-py", line 38, in <module>
    for doc in yaml.load_all(sys.stdin.read()):
  File "/python/lib/python3.12/site-packages/ruamel/yaml/main.py", line 476, in load_all
    yield constructor.get_data()
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/constructor.py", line 110, in get_data
    return self.construct_document(self.composer.get_node())
                                   ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 63, in get_node
    return self.compose_document()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 94, in compose_document
    node = self.compose_node(None, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 130, in compose_node
    node = self.compose_mapping_node(anchor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/composer.py", line 204, in compose_mapping_node
    while not self.parser.check_event(MappingEndEvent):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 141, in check_event
    self.current_event = self.state()
                         ^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/parser.py", line 600, in parse_block_mapping_key
    if self.scanner.check_token(KeyToken):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 170, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.12/site-packages/ruamel/yaml/scanner.py", line 313, in fetch_more_tokens
    raise ScannerError(
ruamel.yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
  in "<unicode string>", line 1, column 5:
    a: b	
        ^ (line: 1)

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 +VAL |
   1    0    0    0 =TEXT|a
   1    1    1    1 -VAL |
   1    1    1    1 -NODE|
   1    1    1    1 =SYNX|:
   1    2    2    2 =WSPC|.
   1    3    3    3 +NODE|
   1    3    3    3 +VAL |
   1    3    3    3 =TEXT|b
   1    4    4    4 -VAL |
   1    4    4    4 -NODE|
   1    4    4    4 =WSPC|\x09
   1    5    5    5 =EOL |\x0a
   2    0    6    6 -PAIR|
   2    0    6    6 +PAIR|
   2    0    6    6 +NODE|
   2    0    6    6 +VAL |
   2    0    6    6 =TEXT|seq
   2    3    9    9 -VAL |
   2    3    9    9 -NODE|
   2    3    9    9 =SYNX|:
   2    4   10   10 +NODE|
   2    4   10   10 =WSPC|\x09
   2    5   11   11 =EOL |\x0a
   3    0   12   12 +SEQ |
   3    0   12   12 =DENT|.
   3    1   13   13 =SYNX|-
   3    2   14   14 =WSPC|.
   3    3   15   15 +NODE|
   3    3   15   15 +VAL |
   3    3   15   15 =TEXT|a
   3    4   16   16 -VAL |
   3    4   16   16 -NODE|
   3    4   16   16 =WSPC|\x09
   3    5   17   17 =EOL |\x0a
   4    0   18   18 -SEQ |
   4    0   18   18 -NODE|
   4    0   18   18 -PAIR|
   4    0   18   18 +PAIR|
   4    0   18   18 +NODE|
   4    0   18   18 +VAL |
   4    0   18   18 =TEXT|c
   4    1   19   19 -VAL |
   4    1   19   19 -NODE|
   4    1   19   19 =SYNX|:
   4    2   20   20 =WSPC|.
   4    3   21   21 +NODE|
   4    3   21   21 +VAL |
   4    3   21   21 =TEXT|d
   4    4   22   22 -VAL |
   4    4   22   22 -NODE|
   4    4   22   22 =WSPC|\x09
   4    5   23   23 +COMM|
   4    5   23   23 =SYNX|#
   4    6   24   24 =META|X
   4    7   25   25 -COMM|
   4    7   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' => 'b',
  'c' => 'd',
  'seq' => [
             'a'
           ]
}

perl-pplibyaml-perl

 na
{
  'a' => 'b',
  'c' => 'd',
  'seq' => [
             'a'
           ]
}

perl-tiny-perl

 na
{
  'a' => 'b',
  'c' => 'd',
  'seq' => [
             'a'
           ]
}

perl-xs-perl

 na
{
  'a' => 'b',
  'c' => 'd',
  'seq' => [
             'a'
           ]
}

perl-yaml-perl

 na
{
  'a' => 'b',
  'c' => 'd',
  'seq' => [
             'a'
           ]
}