# YAML Test Matrix

--- &test-L383
  Title: Two scalar docs with trailing comments
  Tags: [ comment ]

YAML

--- foo  # comment
--- foo  # comment

Expected Events

+STR
+DOC ---
=VAL :foo
-DOC
+DOC ---
=VAL :foo
-DOC
-STR

Expected JSON

"foo"
"foo"

c-libfyaml-event

 ok

c-libyaml-event

 ok

cpp-rapidyaml-event

 ok

cpp-yamlcpp-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

lua-lyaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-syck-json

 json_ok

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

dotnet-yamldotnet-event

 error
+STR
+DOC ---
=VAL :foo
-DOC
+DOC ---
Unhandled exception. YamlDotNet.Core.SemanticErrorException: (Line: 2, Col: 5, Idx: 23) - (Line: 2, Col: 5, Idx: 23): While scanning plain scalar, found a comment between adjacent scalars.
   at YamlDotNet.Core.Parser.ParseNode(Boolean isBlock, Boolean isIndentlessSequence)
   at YamlDotNet.Core.Parser.ParseDocumentContent()
   at YamlDotNet.Core.Parser.StateMachine()
   at YamlDotNet.Core.Parser.MoveNext()
   at YamlDotNet.RepresentationModel.LibYamlEventStream.WriteTo(TextWriter textWriter)
   at Program.Main(String[] commandLineArguments)
Aborted (core dumped)

dotnet-yamldotnet-json

 error
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 2, Col: 1, Idx: 19) - (Line: 2, Col: 4, Idx: 22): Expected 'StreamEnd', got 'DocumentStart' (at Line: 2, Col: 1, Idx: 19).
   at YamlDotNet.Core.ParserExtensions.Require[T](IParser parser)
   at YamlDotNet.Core.ParserExtensions.Consume[T](IParser parser)
   at YamlDotNet.Serialization.Deserializer.Deserialize(IParser parser, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input)
   at Program.Main(String[] commandLineArguments)
Aborted (core dumped)

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 =HEAD|---
   1    3    3    3 =WSPC|.
   1    4    4    4 +NODE|
   1    4    4    4 +VAL |
   1    4    4    4 =TEXT|foo
   1    7    7    7 -VAL |
   1    7    7    7 -NODE|
   1    7    7    7 =WSPC|..
   1    9    9    9 +COMM|
   1    9    9    9 =SYNX|#
   1   10   10   10 =META|.comment
   1   18   18   18 -COMM|
   1   18   18   18 =EOL |\x0a
   2    0   19   19 -DOC |
   2    0   19   19 +DOC |
   2    0   19   19 =HEAD|---
   2    3   22   22 =WSPC|.
   2    4   23   23 +NODE|
   2    4   23   23 +VAL |
   2    4   23   23 =TEXT|foo
   2    7   26   26 -VAL |
   2    7   26   26 -NODE|
   2    7   26   26 =WSPC|..
   2    9   28   28 +COMM|
   2    9   28   28 =SYNX|#
   2   10   29   29 =META|.comment
   2   18   37   37 -COMM|
   2   18   37   37 =EOL |\x0a
   3    0   38   38 -DOC |

perl-pp-perl

 na
'foo'
'foo'

perl-pplibyaml-perl

 na
'foo'
'foo'

perl-syck-perl

 na
'foo'
'foo'

perl-tiny-perl

 na
'foo'
'foo'

perl-xs-perl

 na
'foo'
'foo'

perl-yaml-perl

 na
'foo'
'foo'

py-pyyaml-py

 na
'foo'
'foo'

py-ruamel-py

 na
'foo'
'foo'