--- &test-9WXW
Title: Spec Example 6.18. Primary Tag Handle
Tags: [ 1.3-err, directive, local-tag, spec, tag, unknown-tag ]
# Private
!foo "bar"
...
# Global
%TAG ! tag:example.com,2000:app/
---
!foo "bar"
+STR
+DOC
=VAL <!foo> "bar
-DOC ...
+DOC ---
=VAL <tag:example.com,2000:app/foo> "bar
-DOC
-STR
diff
Minimal Events:
+STR
+DOC
=VAL <!foo> :bar
-DOC ...
+DOC ---
=VAL <tag:example.com,2000:app/foo> :bar
-DOC
-STR
Transformed Events:
+STR
+DOC ---
=VAL <!foo> :bar
-DOC
+DOC ---
=VAL <tag:example.com,2000:app/foo> :bar
-DOC
-STR
Got Events:
+STR
+DOC ---
=VAL <!foo> 'bar
-DOC
+DOC ---
=VAL <tag:example.com,2000:app/foo> 'bar
-DOC
-STR
diff
Minimal Events:
+STR
+DOC
=VAL <!foo> "bar
-DOC
+DOC
=VAL <tag:example.com,2000:app/foo> "bar
-DOC
-STR
Transformed Events:
+STR
+DOC
=VAL <!foo> "bar
-DOC
+DOC
=VAL <!foo> "bar
-DOC
-STR
Got Events:
+STR
+DOC
=VAL <!foo> "bar
-DOC
+DOC
=VAL <!foo> "bar
-DOC
-STR
json_diff
"bar"
"%TAG ! tag:example.com,2000:app/ --- !foo \"bar\""
error
YAML Error: Expected separator '---'
Code: YAML_PARSE_ERR_NO_SEPARATOR
Line: 2
Document: 2
at /perl5/lib/perl5/YAML/Loader.pm line 88.
error
YAML Error: Expected separator '---'
Code: YAML_PARSE_ERR_NO_SEPARATOR
Line: 2
Document: 2
at /perl5/lib/perl5/YAML/Loader.pm line 88.
na
Line Col Char Byte Token|Content
1 0 0 0 +COMM|
1 0 0 0 =SYNX|#
1 1 1 1 =META|.Private
1 9 9 9 -COMM|
1 9 9 9 =EOL |\x0a
2 0 10 10 +DOC |
2 0 10 10 +NODE|
2 0 10 10 +PROP|
2 0 10 10 +TAG |
2 0 10 10 +HAND|
2 0 10 10 =SYNX|!
2 1 11 11 -HAND|
2 1 11 11 =META|foo
2 4 14 14 -TAG |
2 4 14 14 -PROP|
2 4 14 14 =WSPC|.
2 5 15 15 +VAL |
2 5 15 15 =SYNX|"
2 6 16 16 =TEXT|bar
2 9 19 19 =SYNX|"
2 10 20 20 -VAL |
2 10 20 20 -NODE|
2 10 20 20 =EOL |\x0a
3 0 21 21 -DOC |
3 0 21 21 =FOOT|...
3 3 24 24 =EOL |\x0a
4 0 25 25 +COMM|
4 0 25 25 =SYNX|#
4 1 26 26 =META|.Global
4 8 33 33 -COMM|
4 8 33 33 =EOL |\x0a
5 0 34 34 +DOC |
5 0 34 34 +DIR |
5 0 34 34 =SYNX|%
5 1 35 35 =META|TAG
5 4 38 38 =WSPC|.
5 5 39 39 +HAND|
5 5 39 39 =SYNX|!
5 6 40 40 -HAND|
5 6 40 40 =WSPC|.
5 7 41 41 +TAG |
5 7 41 41 =META|tag:example.com,2000:app/
5 32 66 66 -TAG |
5 32 66 66 -DIR |
5 32 66 66 =EOL |\x0a
6 0 67 67 =HEAD|---
6 3 70 70 =EOL |\x0a
7 0 71 71 +NODE|
7 0 71 71 +PROP|
7 0 71 71 +TAG |
7 0 71 71 +HAND|
7 0 71 71 =SYNX|!
7 1 72 72 -HAND|
7 1 72 72 =META|foo
7 4 75 75 -TAG |
7 4 75 75 -PROP|
7 4 75 75 =WSPC|.
7 5 76 76 +VAL |
7 5 76 76 =SYNX|"
7 6 77 77 =TEXT|bar
7 9 80 80 =SYNX|"
7 10 81 81 -VAL |
7 10 81 81 -NODE|
7 10 81 81 =EOL |\x0a
8 0 82 82 -DOC |
na
'bar'
'%TAG ! tag:example.com,2000:app/ --- !foo "bar"'
na
GenericScalar(tag='!foo', content='bar')
GenericScalar(tag='tag:example.com,2000:app/foo', content='bar')
na
GenericScalar(tag='!foo', content='bar')
GenericScalar(tag='tag:example.com,2000:app/foo', content='bar')
ni
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 2, Col: 1, Idx: 10) - (Line: 2, Col: 11, Idx: 20): Encountered an unresolved tag '!foo'
at YamlDotNet.Serialization.NodeTypeResolvers.PreventUnknownTagsNodeTypeResolver.YamlDotNet.Serialization.INodeTypeResolver.Resolve(NodeEvent nodeEvent, Type& currentType)
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.GetTypeFromEvent(NodeEvent nodeEvent, Type currentType)
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
at YamlDotNet.Serialization.Deserializer.Deserialize(IParser parser, Type type)
at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input, Type type)
at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input)
at Program.Main(String[] commandLineArguments)
Aborted (core dumped)
ni
/node/node_modules/js-yaml/lib/loader.js:187
throw generateError(state, message);
^
YAMLException: unknown tag !<!foo> (2:11)
1 | # Private
2 | !foo "bar"
---------------^
3 | ...
4 | # Global
at generateError (/node/node_modules/js-yaml/lib/loader.js:183:10)
at throwError (/node/node_modules/js-yaml/lib/loader.js:187:9)
at composeNode (/node/node_modules/js-yaml/lib/loader.js:1521:7)
at readDocument (/node/node_modules/js-yaml/lib/loader.js:1625:3)
at loadDocuments (/node/node_modules/js-yaml/lib/loader.js:1688:5)
at Object.loadAll (/node/node_modules/js-yaml/lib/loader.js:1701:19)
at Object.<anonymous> (/yaml/bin/js-jsyaml-json:7:13)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32) {
reason: 'unknown tag !<!foo>',
mark: {
name: null,
buffer: '# Private\n' +
'!foo "bar"\n' +
'...\n' +
'# Global\n' +
'%TAG ! tag:example.com,2000:app/\n' +
'---\n' +
'!foo "bar"\n',
position: 20,
line: 1,
column: 10,
snippet: ' 1 | # Private\n 2 | !foo "bar"\n---------------^\n 3 | ...\n 4 | # Global'
}
}
Node.js v20.13.1
ni
YAML::Tiny failed to classify line '!foo "bar"' at /yaml/bin/perl-tiny-json line 12.
ni
YAML::Tiny failed to classify line '!foo "bar"' at /yaml/bin/perl-tiny-perl line 15.
ni
YAML::XS Error: bad tag found for scalar: 'tag:example.com,2000:app/foo' at /yaml/bin/perl-xs-json line 14, <> line 1.
ni
YAML::XS Error: bad tag found for scalar: 'tag:example.com,2000:app/foo' at /yaml/bin/perl-xs-perl line 16, <> line 1.