# YAML Test Matrix

--- &test-HM87:00
  Title: Scalars in flow start with syntax char
  Tags: [ flow, scalar ]

YAML

[:x]

Expected Events

+STR
+DOC
+SEQ []
=VAL ::x
-SEQ
-DOC
-STR

Expected JSON

[
":x"
]

c-libfyaml-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-ruamel-event

 ok

rust-yamlrust-event

 ok

c-libfyaml-json

 json_ok

dotnet-yamldotnet-json

 json_ok

hs-hsyaml-json

 json_ok

js-jsyaml-json

 json_ok

js-yaml-json

 json_ok

perl-pp-json

 json_ok

perl-syck-json

 json_ok

py-ruamel-json

 json_ok

c-libyaml-event

 error
+STR
+DOC
+SEQ []
Parse error: did not find expected node content

go-yaml-json

 error
yaml: did not find expected node content

lua-lyaml-json

 error
luajit: 1:1: did not find expected node content
stack traceback:
	[C]: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:306: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:325: in function 'parse'
	/usr/local/share/lua/5.1/lyaml/init.lua:443: in function 'load_node'
	/usr/local/share/lua/5.1/lyaml/init.lua:393: in function 'load_node'
	/usr/local/share/lua/5.1/lyaml/init.lua:497: in function 'load'
	/yaml/bin/lua-lyaml-json:6: in main chunk
	[C]: at 0x55f7e6f74ed0

perl-pplibyaml-json

 error
YAML::PP::LibYAML Error: The problem:

    did not find expected node content

was found at , line: 1, column: 2
while parsing a flow node at line: 1, column: 2

perl-pplibyaml-perl

 error
YAML::PP::LibYAML Error: The problem:

    did not find expected node content

was found at , line: 1, column: 2
while parsing a flow node at line: 1, column: 2

perl-xs-json

 error
YAML::XS::Load Error: The problem:

    did not find expected node content

was found at document: 1, line: 1, column: 2
while parsing a flow node at line: 1, column: 2

perl-xs-perl

 error
YAML::XS::Load Error: The problem:

    did not find expected node content

was found at document: 1, line: 1, column: 2
while parsing a flow node at line: 1, column: 2

perl-yaml-json

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 1
   Document: 2
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

perl-yaml-perl

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 1
   Document: 2
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

py-pyyaml-event

 error
+STR
+DOC
+SEQ []
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 474, in parse_flow_sequence_first_entry
    return self.parse_flow_sequence_entry(first=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 495, in parse_flow_sequence_entry
    return self.parse_flow_node()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 268, in parse_flow_node
    return self.parse_node()
           ^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 369, in parse_node
    raise ParserError("while parsing a %s node" % node, start_mark,
yaml.parser.ParserError: while parsing a flow node
expected the node content, but found ':'
  in "<unicode string>", line 1, column 2:
    [:x]
     ^

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 82, in compose_node
    node = self.compose_sequence_node(anchor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 110, in compose_sequence_node
    while not self.check_event(SequenceEndEvent):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 474, in parse_flow_sequence_first_entry
    return self.parse_flow_sequence_entry(first=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 495, in parse_flow_sequence_entry
    return self.parse_flow_node()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 268, in parse_flow_node
    return self.parse_node()
           ^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 369, in parse_node
    raise ParserError("while parsing a %s node" % node, start_mark,
yaml.parser.ParserError: while parsing a flow node
expected the node content, but found ':'
  in "<unicode string>", line 1, column 2:
    [:x]
     ^

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 82, in compose_node
    node = self.compose_sequence_node(anchor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/composer.py", line 110, in compose_sequence_node
    while not self.check_event(SequenceEndEvent):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 474, in parse_flow_sequence_first_entry
    return self.parse_flow_sequence_entry(first=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 495, in parse_flow_sequence_entry
    return self.parse_flow_node()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 268, in parse_flow_node
    return self.parse_node()
           ^^^^^^^^^^^^^^^^^
  File "/python/lib/python3.12/site-packages/yaml/parser.py", line 369, in parse_node
    raise ParserError("while parsing a %s node" % node, start_mark,
yaml.parser.ParserError: while parsing a flow node
expected the node content, but found ':'
  in "<unicode string>", line 1, column 2:
    [:x]
     ^

ruby-psych-json

 error
/ruby/gems/psych/lib/psych.rb:458:in `parse': (<unknown>): did not find expected node content while parsing a flow node at line 1 column 2 (Psych::SyntaxError)
	from /ruby/gems/psych/lib/psych.rb:458:in `parse_stream'
	from /ruby/gems/psych/lib/psych.rb:632:in `load_stream'
	from /yaml/bin/ruby-psych-json:6:in `<main>'

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 =SYNX|[
   1    1    1    1 +NODE|
   1    1    1    1 +VAL |
   1    1    1    1 =TEXT|:x
   1    3    3    3 -VAL |
   1    3    3    3 -NODE|
   1    3    3    3 =SYNX|]
   1    4    4    4 -SEQ |
   1    4    4    4 -NODE|
   1    4    4    4 =EOL |\x0a
   2    0    5    5 -DOC |

perl-pp-perl

 na
[
  ':x'
]

perl-syck-perl

 na
[
  ':x'
]

py-ruamel-py

 na
[':x']

perl-tiny-json

 ni
YAML::Tiny failed to classify line '[:x]' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny failed to classify line '[:x]' at /yaml/bin/perl-tiny-perl line 15.