YAML Framework Matrix

Test #6M2F - Aliases in Explicit Block Mapping

YAML

? &a a
: &b b
: *a

Expected Events

+STR
+DOC
+MAP
=VAL &a :a
=VAL &b :b
=VAL :
=ALI *a
-MAP
-DOC
-STR

Expected JSON



cpp-event

 ok

java-event

 error
Exception in thread "main" while parsing a block mapping
 in 'reader', line 1, column 1:
    ? &a a
    ^
expected <block end>, but found Value
 in 'reader', line 3, column 1:
    : *a
    ^

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

java-json

 error
Exception in thread "main" while parsing a block mapping
 in 'reader', line 1, column 1:
    ? &a a
    ^
expected <block end>, but found Value
 in 'reader', line 3, column 1:
    : *a
    ^

	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:571)
	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.composeMappingNode(Composer.java:227)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:154)
	at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122)
	at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:84)
	at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:105)
	at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:526)
	at org.yaml.editor.Snake2Json.yamlToJson(Snake2Json.java:18)
	at org.yaml.editor.Snake2Json.main(Snake2Json.java:25)

js-yaml-json

 error
YAMLException: incomplete explicit mapping pair; a key node is missed at line 3, column 1:
    : *a
    ^
    at generateError (/node_modules/js-yaml/lib/js-yaml/loader.js:162:10)
    at throwError (/node_modules/js-yaml/lib/js-yaml/loader.js:168:9)
    at readBlockMapping (/node_modules/js-yaml/lib/js-yaml/loader.js:999:9)
    at composeNode (/node_modules/js-yaml/lib/js-yaml/loader.js:1331:12)
    at readDocument (/node_modules/js-yaml/lib/js-yaml/loader.js:1493:3)
    at loadDocuments (/node_modules/js-yaml/lib/js-yaml/loader.js:1549:5)
    at Object.loadAll (/node_modules/js-yaml/lib/js-yaml/loader.js:1557:19)
    at Object.<anonymous> (/bin/js-yaml-json:6:6)
    at Object.<anonymous> (/bin/js-yaml-json:3:1)
    at Module._compile (module.js:410:26)
    at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:173:23)
    at compileScript (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:224:29)
    at compilePath (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:174:14)
    at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:98:20)
    at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/coffee:7:41)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3

libyaml-event

 error
Parse error: did not find expected key
+STR
+DOC
+MAP
=VAL &a :a
=VAL &b :b

luajit-json

 error
luajit: did not find expected key at document: 1, line: 3, column: 1
while parsing a block mapping at line: 1, 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

 n/a
{"":"a","a":"b"}

perl5-pm-pl

 n/a
{
  '' => 'a',
  'a' => 'b'
}

perl5-pp-event

 ok

perl5-pp-json

 n/a
{
   "" : null,
   "a" : "b"
}

perl5-pp-pl

 n/a
{
  '' => undef,
  'a' => 'b'
}

perl5-syck-json

 error
Syck parser (line 3, column 1): syntax error 

perl5-syck-pl

 error
Syck parser (line 3, column 1): syntax error 

perl5-tiny-json

 error
YAML::Tiny does not support a feature in line '? &a a' 

perl5-tiny-pl

 error
YAML::Tiny does not support a feature in line '? &a a' 

perl5-xs-json

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

    did not find expected key

was found at document: 1, line: 3, column: 1
while parsing a block mapping at line: 1, column: 1

perl5-xs-pl

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

    did not find expected key

was found at document: 1, line: 3, column: 1
while parsing a block mapping at line: 1, column: 1

pyyaml-event

 error
+STR
+DOC
+MAP
=VAL &a :a
=VAL &b :b
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 439, in parse_block_mapping_key
    "expected <block end>, but found %r" % token.id, token.start_mark)
yaml.parser.ParserError: while parsing a block mapping
  in "<string>", line 1, column 1:
    ? &a a
    ^
expected <block end>, but found ':'
  in "<string>", line 3, column 1:
    : *a
    ^

ruamel-event

 error
+STR
+DOC
+MAP
=VAL &a :a
=VAL &b :b
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 532, in parse_block_mapping_key
    token.start_mark)
ruamel.yaml.parser.ParserError: while parsing a block mapping
  in "<byte string>", line 1, column 1:
    ? &a a
    ^ (line: 1)
expected <block end>, but found ':'
  in "<byte string>", line 3, column 1:
    : *a
    ^ (line: 3)

ruby-json

 error
/usr/lib/ruby/2.3.0/psych.rb:380:in `parse': (<unknown>): did not find expected key while parsing a block mapping 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>'