YAML Framework Matrix

Test #W5VH - Allowed characters in alias

YAML

a: &:@*!$"<foo>: scalar a
b: *:@*!$"<foo>:

Expected Events

+STR
+DOC
+MAP
=VAL :a
=VAL &:@*!$"<foo>: :scalar a
=VAL :b
=ALI *:@*!$"<foo>:
-MAP
-DOC
-STR

Expected JSON

{
"a" : "scalar a",
"b" : "scalar a"
}

cpp-event

 ok

java-event

 error
Exception in thread "main" while scanning an anchor
 in 'reader', line 1, column 4:
    a: &:@*!$"<foo>: scalar a
       ^
expected alphabetic or numeric character, but found :(58)
 in 'reader', line 1, column 5:
    a: &:@*!$"<foo>: scalar a
        ^

	at org.yaml.snakeyaml.scanner.ScannerImpl.scanAnchor(ScannerImpl.java:1447)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchAnchor(ScannerImpl.java:939)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:370)
	at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:585)
	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
Exception in thread "main" while scanning an anchor
 in 'reader', line 1, column 4:
    a: &:@*!$"<foo>: scalar a
       ^
expected alphabetic or numeric character, but found :(58)
 in 'reader', line 1, column 5:
    a: &:@*!$"<foo>: scalar a
        ^

	at org.yaml.snakeyaml.scanner.ScannerImpl.scanAnchor(ScannerImpl.java:1447)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchAnchor(ScannerImpl.java:939)
	at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:370)
	at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:585)
	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.composeNode(Composer.java:133)
	at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:249)
	at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:240)
	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:228)
	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:123)
	at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:547)
	at org.yaml.editor.Snake2Json.yamlToJson(Snake2Json.java:18)
	at org.yaml.editor.Snake2Json.main(Snake2Json.java:25)

js-yaml-json

 json_ok

libyaml-event

 error
+STR
+DOC
+MAP
=VAL :a
Parse error: did not find expected alphabetic or numeric character

luajit-json

 error
luajit: did not find expected alphabetic or numeric character at document: 1, line: 1, column: 5
while scanning an anchor at line: 1, column: 4

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: Invalid anchor
   Code: YAML_PARSE_ERR_BAD_ANCHOR
   Line: 2
   Document: 1
 at /lib/perl5/YAML/Loader.pm line 231.

perl5-pm-pl

 error
YAML Error: Invalid anchor
   Code: YAML_PARSE_ERR_BAD_ANCHOR
   Line: 2
   Document: 1
 at /lib/perl5/YAML/Loader.pm line 231.

perl5-pp-event

 ok

perl5-pp-json

 json_ok

perl5-pp-pl

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

perl5-syck-json

 error
Syck parser (line 1, column 16): syntax error at /lib/perl5/x86_64-linux-gnu-thread-multi/YAML/Syck.pm line 75, <> line 1.

perl5-syck-pl

 error
Syck parser (line 1, column 16): syntax error at /lib/perl5/x86_64-linux-gnu-thread-multi/YAML/Syck.pm line 75, <> line 1.

perl5-tiny-json

 error
YAML::Tiny does not support a feature in line '&:@*!$"<foo>: scalar a' at /bin/perl5-tiny-json line 14.

perl5-tiny-pl

 error
YAML::Tiny does not support a feature in line '&:@*!$"<foo>: scalar a' at /bin/perl5-tiny-pl line 13.

perl5-xs-json

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

    did not find expected alphabetic or numeric character

was found at document: 1, line: 1, column: 5
while scanning an anchor at line: 1, column: 4

perl5-xs-pl

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

    did not find expected alphabetic or numeric character

was found at document: 1, line: 1, column: 5
while scanning an anchor at line: 1, column: 4

pyyaml-event

 error
+STR
+DOC
+MAP
=VAL :a
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 449, in parse_block_mapping_value
    if not self.check_token(KeyToken, ValueToken, BlockEndToken):
  File "/lib/python2.7/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/lib/python2.7/site-packages/yaml/scanner.py", line 228, in fetch_more_tokens
    return self.fetch_anchor()
  File "/lib/python2.7/site-packages/yaml/scanner.py", line 618, in fetch_anchor
    self.tokens.append(self.scan_anchor(AnchorToken))
  File "/lib/python2.7/site-packages/yaml/scanner.py", line 926, in scan_anchor
    % ch.encode('utf-8'), self.get_mark())
yaml.scanner.ScannerError: while scanning an anchor
  in "<string>", line 1, column 4:
    a: &:@*!$"<foo>: scalar a
       ^
expected alphabetic or numeric character, but found ':'
  in "<string>", line 1, column 5:
    a: &:@*!$"<foo>: scalar a
        ^

ruamel-event

 ok

ruby-json

 error
/usr/lib/ruby/2.3.0/psych.rb:380:in `parse': (<unknown>): did not find expected alphabetic or numeric character while scanning an anchor at line 1 column 4 (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>'