# YAML Test Matrix

--- &test-8XYN
  Title: Anchor with unicode character
  Tags: [ anchor ]

YAML

---
- &😁 unicode anchor

Expected Events

+STR
+DOC ---
+SEQ
=VAL &😁 :unicode anchor
-SEQ
-DOC
-STR

Expected JSON

[
"unicode anchor"
]

c-libfyaml-event

 ok

cpp-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

java-snakeyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

py-ruamel-event

 ok

c-libfyaml-json

 json_ok

dotnet-yamldotnet-json

 json_ok

hs-hsyaml-json

 json_ok

java-snakeyaml-json

 json_ok

js-jsyaml-json

 json_ok

js-yaml-json

 json_ok

perl-pp-json

 json_ok

py-ruamel-json

 json_ok

perl-syck-json

 json_diff
[
  "&😁 unicode anchor"
]

c-libyaml-event

 error
+STR
+DOC ---
+SEQ
Parse error: did not find expected alphabetic or numeric character

lua-lyaml-json

 error
luajit: 2:1: did not find expected alphabetic or numeric character
stack traceback:
	[C]: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:291: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:310: in function 'parse'
	/usr/local/share/lua/5.1/lyaml/init.lua:428: in function 'load_node'
	/usr/local/share/lua/5.1/lyaml/init.lua:378: in function 'load_node'
	/usr/local/share/lua/5.1/lyaml/init.lua:482: in function 'load'
	/yaml/bin/lua-lyaml-json:6: in main chunk
	[C]: at 0x55b83fb22f97

perl-pplibyaml-event

 error
YAML::PP::LibYAML Error: The problem:

    did not find expected alphabetic or numeric character

was found at , line: 2, column: 4
while scanning an anchor at line: 2, column: 3

perl-pplibyaml-json

 error
YAML::PP::LibYAML Error: The problem:

    did not find expected alphabetic or numeric character

was found at , line: 2, column: 4
while scanning an anchor at line: 2, column: 3

perl-pplibyaml-perl

 error
YAML::PP::LibYAML Error: The problem:

    did not find expected alphabetic or numeric character

was found at , line: 2, column: 4
while scanning an anchor at line: 2, column: 3

perl-xs-json

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

    did not find expected alphabetic or numeric character

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

perl-xs-perl

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

    did not find expected alphabetic or numeric character

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

perl-yaml-json

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

perl-yaml-perl

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

py-pyyaml-event

 error
+STR
+DOC ---
+SEQ
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-event", line 7, in <module>
    for event in yaml.parse(sys.stdin.read()):
  File "/python/lib/python3.7/site-packages/yaml/__init__.py", line 75, in parse
    while loader.check_event():
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 379, in parse_block_sequence_first_entry
    return self.parse_block_sequence_entry()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 384, in parse_block_sequence_entry
    if not self.check_token(BlockEntryToken, BlockEndToken):
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 231, in fetch_more_tokens
    return self.fetch_anchor()
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 621, in fetch_anchor
    self.tokens.append(self.scan_anchor(AnchorToken))
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 924, in scan_anchor
    % ch, self.get_mark())
yaml.scanner.ScannerError: while scanning an anchor
  in "<unicode string>", line 2, column 3:
    - &😁 unicode anchor
      ^
expected alphabetic or numeric character, but found '😁'
  in "<unicode string>", line 2, column 4:
    - &😁 unicode anchor
       ^

py-pyyaml-json

 error
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-json", line 19, in <module>
    for doc in yaml.load_all(sys.stdin.read(), Loader=yaml.FullLoader):
  File "/python/lib/python3.7/site-packages/yaml/__init__.py", line 130, in load_all
    yield loader.get_data()
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 45, in get_data
    return self.construct_document(self.get_node())
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 27, in get_node
    return self.compose_document()
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 110, in compose_sequence_node
    while not self.check_event(SequenceEndEvent):
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 379, in parse_block_sequence_first_entry
    return self.parse_block_sequence_entry()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 384, in parse_block_sequence_entry
    if not self.check_token(BlockEntryToken, BlockEndToken):
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 231, in fetch_more_tokens
    return self.fetch_anchor()
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 621, in fetch_anchor
    self.tokens.append(self.scan_anchor(AnchorToken))
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 924, in scan_anchor
    % ch, self.get_mark())
yaml.scanner.ScannerError: while scanning an anchor
  in "<unicode string>", line 2, column 3:
    - &😁 unicode anchor
      ^
expected alphabetic or numeric character, but found '😁'
  in "<unicode string>", line 2, column 4:
    - &😁 unicode anchor
       ^

py-pyyaml-py

 error
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-py", line 36, in <module>
    for doc in yaml.load_all(sys.stdin.read(), Loader=yaml.FullLoader):
  File "/python/lib/python3.7/site-packages/yaml/__init__.py", line 130, in load_all
    yield loader.get_data()
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 45, in get_data
    return self.construct_document(self.get_node())
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 27, in get_node
    return self.compose_document()
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 110, in compose_sequence_node
    while not self.check_event(SequenceEndEvent):
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 379, in parse_block_sequence_first_entry
    return self.parse_block_sequence_entry()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 384, in parse_block_sequence_entry
    if not self.check_token(BlockEntryToken, BlockEndToken):
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 231, in fetch_more_tokens
    return self.fetch_anchor()
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 621, in fetch_anchor
    self.tokens.append(self.scan_anchor(AnchorToken))
  File "/python/lib/python3.7/site-packages/yaml/scanner.py", line 924, in scan_anchor
    % ch, self.get_mark())
yaml.scanner.ScannerError: while scanning an anchor
  in "<unicode string>", line 2, column 3:
    - &😁 unicode anchor
      ^
expected alphabetic or numeric character, but found '😁'
  in "<unicode string>", line 2, column 4:
    - &😁 unicode anchor
       ^

ruby-psych-json

 error
/usr/lib/ruby/2.5.0/psych.rb:405:in `parse': (<unknown>): did not find expected alphabetic or numeric character while scanning an anchor at line 2 column 3 (Psych::SyntaxError)
	from /usr/lib/ruby/2.5.0/psych.rb:405:in `parse_stream'
	from /usr/lib/ruby/2.5.0/psych.rb:488:in `load_stream'
	from /yaml/bin/ruby-psych-json:6:in `<main>'

perl-pp-perl

 na
[
  'unicode anchor'
]

perl-syck-perl

 na
[
  "&\x{1f601} unicode anchor"
]

py-ruamel-py

 na
['unicode anchor']

perl-tiny-json

 ni
YAML::Tiny does not support a feature in line '&😁 unicode anchor' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny does not support a feature in line '&😁 unicode anchor' at /yaml/bin/perl-tiny-perl line 15.