YAML Framework Matrix

Test #BU8L - Node Anchor and Tag on Seperate Lines

YAML

key: &anchor
 !tag
  a: b

Expected Events

+STR
+DOC
+MAP
=VAL :key
+MAP &anchor <!tag>
=VAL :a
=VAL :b
-MAP
-MAP
-DOC
-STR

Expected JSON



cpp-event

 ok

java-event

 ok

java-json

 error
Exception in thread "main" Can't construct a java object for !tag; exception=Invalid tag: !tag
 in 'reader', line 1, column 6:
    key: &anchor
         ^

	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:351)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:184)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:376)
	at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:185)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:357)
	at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:532)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:184)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:143)
	at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:109)
	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)
Caused by: org.yaml.snakeyaml.error.YAMLException: Invalid tag: !tag
	at org.yaml.snakeyaml.nodes.Tag.getClassName(Tag.java:112)
	at org.yaml.snakeyaml.constructor.Constructor.getClassForNode(Constructor.java:661)
	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.getConstructor(Constructor.java:336)
	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:346)
	... 11 more

js-yaml-json

 error
YAMLException: unknown tag !<!tag> at line 4, column 1:
    
    ^
    at generateError (/node_modules/js-yaml/lib/js-yaml/loader.js:165:10)
    at throwError (/node_modules/js-yaml/lib/js-yaml/loader.js:171:9)
    at composeNode (/node_modules/js-yaml/lib/js-yaml/loader.js:1401:7)
    at readBlockMapping (/node_modules/js-yaml/lib/js-yaml/loader.js:1062:11)
    at composeNode (/node_modules/js-yaml/lib/js-yaml/loader.js:1332:12)
    at readDocument (/node_modules/js-yaml/lib/js-yaml/loader.js:1492:3)
    at loadDocuments (/node_modules/js-yaml/lib/js-yaml/loader.js:1548:5)
    at Object.loadAll (/node_modules/js-yaml/lib/js-yaml/loader.js:1556: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

 ok

luajit-json

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

nimyaml-event

 ok

perl5-pegex-event

 diff
Got Events:
+STR
+DOC
+MAP
=VAL :key
+MAP <!tag>
=VAL :  a
=VAL &anchor :b
-MAP
-MAP
-DOC
-STR

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
{
   "key" : {
      "a" : "b"
   }
}

perl5-pp-pl

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

perl5-syck-json

 n/a
{"key":"tag=HASH(0x21fe658)"}

perl5-syck-pl

 n/a
{
  'key' => bless( {
                    'a' => 'b'
                  }, 'tag' )
}

perl5-tiny-json

 error
YAML::Tiny does not support a feature in line '&anchor' at /bin/perl5-tiny-json line 14.

perl5-tiny-pl

 error
YAML::Tiny does not support a feature in line '&anchor' at /bin/perl5-tiny-pl line 13.

perl5-xs-json

 n/a
{"key":"tag=HASH(0x18919e8)"}

perl5-xs-pl

 n/a
{
  'key' => bless( {
                    'a' => 'b'
                  }, 'tag' )
}

pyyaml-event

 ok

ruamel-event

 ok

ruby-json

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