YAML Test Matrix

Test #7Z25 - Bare document after document end marker

YAML

---
scalar1
...
key: value

Expected Events

+STR
+DOC ---
=VAL :scalar1
-DOC ...
+DOC
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
-STR

Expected JSON



cpp-event

 ok

java-event

 error
Exception in thread "main" expected '<document start>', but found BlockMappingStart
 in 'reader', line 4, column 1:
    key: value
    ^

	at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentStart.produce(ParserImpl.java:225)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:157)
	at org.yaml.snakeyaml.Yaml$3.hasNext(Yaml.java:713)
	at org.yaml.editor.Snake2Events.yamlToEvents(Snake2Events.java:109)
	at org.yaml.editor.Snake2Events.main(Snake2Events.java:117)

java-json

 error
"scalar1"
Exception in thread "main" expected '<document start>', but found BlockMappingStart
 in 'reader', line 4, column 1:
    key: value
    ^

	at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentStart.produce(ParserImpl.java:225)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:157)
	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:147)
	at org.yaml.snakeyaml.composer.Composer.checkNode(Composer.java:68)
	at org.yaml.snakeyaml.constructor.BaseConstructor.checkData(BaseConstructor.java:112)
	at org.yaml.snakeyaml.Yaml$1.hasNext(Yaml.java:542)
	at org.yaml.editor.Snake2Json.yamlToJson(Snake2Json.java:18)
	at org.yaml.editor.Snake2Json.main(Snake2Json.java:25)

js-yaml-json

 n/a
"scalar1"
{
  "key": "value"
}

libyaml-event

 error
+STR
+DOC ---
=VAL :scalar1
-DOC ...
Parse error: did not find expected <document start>

luajit-json

 error
luajit: did not find expected <document start> at document: 1, line: 4, column: 1

stack traceback:
	[C]: in function 'load'
	/bin/luajit-json:6: in main chunk
	[C]: at 0x004044a0

nimyaml-event

 ok

perl5-pegex-event

 error
Maximum parsing rules reached (1000)

perl5-pm-json

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

perl5-pm-pl

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

perl5-pp-event

 ok

perl5-pp-json

 n/a
"scalar1"
{
   "key" : "value"
}

perl5-pp-pl

 n/a
'scalar1'
{
  'key' => 'value'
}

perl5-syck-json

 n/a
{"scalar1 ... key":"value"}

perl5-syck-pl

 n/a
{
  'scalar1 ... key' => 'value'
}

perl5-tiny-json

 error
YAML::Tiny failed to classify line 'scalar1' at /bin/perl5-tiny-json line 14.

perl5-tiny-pl

 error
YAML::Tiny failed to classify line 'scalar1' at /bin/perl5-tiny-pl line 13.

perl5-xs-json

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

    did not find expected <document start>

was found at document: 2, line: 4, column: 1

perl5-xs-pl

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

    did not find expected <document start>

was found at document: 2, line: 4, column: 1

pyyaml-event

 error
+STR
+DOC ---
=VAL :scalar1
-DOC ...
Traceback (most recent call last):
  File "/bin/pyyaml-event", line 7, in <module>
    for event in yaml.parse(sys.stdin.read()):
  File "/lib/python2.7/site-packages/yaml/__init__.py", line 36, in parse
    while loader.check_event():
  File "/lib/python2.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/lib/python2.7/site-packages/yaml/parser.py", line 174, in parse_document_start
    self.peek_token().start_mark)
yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "<string>", line 4, column 1:
    key: value
    ^

pyyaml-json

 error
"scalar1"
Traceback (most recent call last):
  File "/bin/pyyaml-json", line 8, in <module>
    for doc in yaml.load_all(sys.stdin.read()):
  File "/lib/python2.7/site-packages/yaml/__init__.py", line 89, in load_all
    while loader.check_data():
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 28, in check_data
    return self.check_node()
  File "/lib/python2.7/site-packages/yaml/composer.py", line 18, in check_node
    if self.check_event(StreamStartEvent):
  File "/lib/python2.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/lib/python2.7/site-packages/yaml/parser.py", line 174, in parse_document_start
    self.peek_token().start_mark)
yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "<string>", line 4, column 1:
    key: value
    ^

pyyaml-py

 error
'scalar1'
Traceback (most recent call last):
  File "/bin/pyyaml-py", line 7, in <module>
    for doc in yaml.load_all(sys.stdin.read()):
  File "/lib/python2.7/site-packages/yaml/__init__.py", line 89, in load_all
    while loader.check_data():
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 28, in check_data
    return self.check_node()
  File "/lib/python2.7/site-packages/yaml/composer.py", line 18, in check_node
    if self.check_event(StreamStartEvent):
  File "/lib/python2.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/lib/python2.7/site-packages/yaml/parser.py", line 174, in parse_document_start
    self.peek_token().start_mark)
yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "<string>", line 4, column 1:
    key: value
    ^

ruamel-event

 error
+STR
+DOC ---
=VAL :scalar1
-DOC ...
Traceback (most recent call last):
  File "/bin/ruamel-event", line 7, in <module>
    for event in ruamel.yaml.parse(sys.stdin.read()):
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/main.py", line 52, in parse
    while loader._parser.check_event():
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/parser.py", line 130, in check_event
    self.current_event = self.state()
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/parser.py", line 209, in parse_document_start
    self.scanner.peek_token().start_mark)
ruamel.yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "<byte string>", line 4, column 1:
    key: value
    ^ (line: 4)

ruamel-json

 error
"scalar1"
Traceback (most recent call last):
  File "/bin/ruamel-json", line 8, in <module>
    for doc in ruamel.yaml.load_all(sys.stdin.read(), Loader=ruamel.yaml.Loader):
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/main.py", line 112, in load_all
    while loader._constructor.check_data():
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/constructor.py", line 73, in check_data
    return self.composer.check_node()
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/composer.py", line 50, in check_node
    if self.parser.check_event(StreamStartEvent):
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/parser.py", line 130, in check_event
    self.current_event = self.state()
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/parser.py", line 209, in parse_document_start
    self.scanner.peek_token().start_mark)
ruamel.yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "<byte string>", line 4, column 1:
    key: value
    ^ (line: 4)

ruamel-py

 error
'scalar1'
Traceback (most recent call last):
  File "/bin/ruamel-py", line 7, in <module>
    for doc in ruamel.yaml.load_all(sys.stdin.read(), Loader=ruamel.yaml.Loader):
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/main.py", line 112, in load_all
    while loader._constructor.check_data():
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/constructor.py", line 73, in check_data
    return self.composer.check_node()
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/composer.py", line 50, in check_node
    if self.parser.check_event(StreamStartEvent):
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/parser.py", line 130, in check_event
    self.current_event = self.state()
  File "/usr/local/lib/python2.7/dist-packages/ruamel/yaml/parser.py", line 209, in parse_document_start
    self.scanner.peek_token().start_mark)
ruamel.yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "<byte string>", line 4, column 1:
    key: value
    ^ (line: 4)

ruby-json

 error
/usr/lib/ruby/2.3.0/psych.rb:380:in `parse': (<unknown>): did not find expected <document start> at line 1 column 1 (Psych::SyntaxError)
	from /usr/lib/ruby/2.3.0/psych.rb:380:in `parse_stream'
	from /usr/lib/ruby/2.3.0/psych.rb:463:in `load_stream'
	from /bin/ruby-json:6:in `<main>'