--- &test-9HCY
Title: Need document footer before directives
Tags: [ directive, error, footer, tag, unknown-tag ]
!foo "bar"
%TAG ! tag:example.com,2000:app/
---
!foo "bar"
+STR
+DOC
=VAL <!foo> "bar
invalid_incorrect
+STR
+DOC
=VAL <!foo> "bar
-DOC
+DOC ---
=VAL <tag:example.com,2000:app/foo> "bar
-DOC
-STR
invalid_incorrect
+STR
+DOC ---
=VAL <!foo> 'bar
-DOC
+DOC ---
=VAL <!foo> 'bar
-DOC
-STR
invalid_incorrect
+STR
+DOC
=VAL <!foo> :bar
-DOC
+DOC
=VAL <tag:example.com,2000:app/foo> :bar
-DOC
-STR
invalid_incorrect
"bar"
"bar"
invalid_incorrect
Line Col Char Byte Token|Content
1 0 0 0 +DOC |
1 0 0 0 +NODE|
1 0 0 0 +PROP|
1 0 0 0 +TAG |
1 0 0 0 +HAND|
1 0 0 0 =SYNX|!
1 1 1 1 -HAND|
1 1 1 1 =META|foo
1 4 4 4 -TAG |
1 4 4 4 -PROP|
1 4 4 4 =WSPC|.
1 5 5 5 +VAL |
1 5 5 5 =SYNX|"
1 6 6 6 =TEXT|bar
1 9 9 9 =SYNX|"
1 10 10 10 -VAL |
1 10 10 10 -NODE|
1 10 10 10 =EOL |\x0a
2 0 11 11 -DOC |
2 0 11 11 =ERR |Unexpected.'%'
invalid_incorrect
"bar"
"bar"
invalid_incorrect
"bar"
"bar"
invalid_incorrect
'bar'
'bar'
invalid_incorrect
+STR
+DOC
=VAL <!foo> "bar
-DOC
+DOC ---
=VAL <tag:example.com,2000:app/foo> "bar
-DOC
-STR
invalid_incorrect
"bar"
"bar"
invalid_incorrect
GenericScalar(tag='!foo', content='bar')
GenericScalar(tag='tag:example.com,2000:app/foo', content='bar')
invalid_incorrect
+STR
+DOC
=VAL <!foo> "bar
-DOC
+DOC ---
=VAL <tag:example.com,2000:app/foo> "bar
-DOC
-STR
invalid_incorrect
"bar"
"bar"
invalid_incorrect
GenericScalar(tag='!foo', content='bar')
GenericScalar(tag='tag:example.com,2000:app/foo', content='bar')
invalid_incorrect
"bar"
"bar"
invalid_incorrect
+STR
+DOC
=VAL <!foo> "bar
-DOC
+DOC
=VAL <!foo> "bar
-DOC
-STR
invalid_correct
stdin:2:6: error: missing explicit document end marker before directive(s)
%TAG ! tag:example.com,2000:app/
^~~~~~~~~~~~~~~~~~~~~~~~~~~
+STR
+DOC
=VAL <!foo> "bar
invalid_correct
stdin:2:6: error: missing explicit document end marker before directive(s)
%TAG ! tag:example.com,2000:app/
^~~~~~~~~~~~~~~~~~~~~~~~~~~
invalid_correct
Unhandled exception. YamlDotNet.Core.SemanticErrorException: (Line: 2, Col: 1, Idx: 11) - (Line: 2, Col: 1, Idx: 11): Did not find expected <document end>.
at YamlDotNet.Core.Parser.ParseDocumentEnd()
at YamlDotNet.Core.Parser.StateMachine()
at YamlDotNet.Core.Parser.MoveNext()
at YamlDotNet.RepresentationModel.LibYamlEventStream.WriteTo(TextWriter textWriter)
at Program.Main(String[] commandLineArguments)
Aborted (core dumped)
+STR
+DOC
=VAL <!foo> "bar
invalid_correct
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 11, Idx: 10): 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)
invalid_correct
Parsing error near byte offset Pos {posByteOffset = 11, posCharOffset = 11, posLine = 2, posColumn = 0} (Unexpected '%')
+STR
+DOC
=VAL <!foo> "bar
-DOC
invalid_correct
hsyaml-parser: user error (Unexpected '%')
invalid_correct
/node/node_modules/js-yaml/lib/loader.js:187
throw generateError(state, message);
^
YAMLException: unknown tag !<!foo> (1:11)
1 | !foo "bar"
---------------^
2 | %TAG ! tag:example.com,2000:app/
3 | ---
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: '!foo "bar"\n%TAG ! tag:example.com,2000:app/\n---\n!foo "bar"\n',
position: 10,
line: 0,
column: 10,
snippet: ' 1 | !foo "bar"\n' +
'---------------^\n' +
' 2 | %TAG ! tag:example.com,2000:app/\n' +
' 3 | ---'
}
}
Node.js v20.13.1
invalid_correct
Unexpected scalar at node end at line 2, column 1:
!foo "bar"
%TAG ! tag:example.com,2000:app/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+STR
+DOC
=VAL <!foo> "bar
-DOC
+DOC ---
=VAL <!foo> "bar
-DOC
-STR
invalid_correct
/yaml/bin/js-yaml-json:9
if (doc.errors.length !== 0) throw doc.errors[0]
^
YAMLParseError: Unexpected scalar at node end at line 2, column 1:
!foo "bar"
%TAG ! tag:example.com,2000:app/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at Composer.onError (/node/node_modules/yaml/dist/compose/composer.js:69:34)
at Object.resolveEnd (/node/node_modules/yaml/dist/compose/resolve-end.js:31:21)
at Object.composeDoc (/node/node_modules/yaml/dist/compose/compose-doc.js:37:27)
at Composer.next (/node/node_modules/yaml/dist/compose/composer.js:149:40)
at next (<anonymous>)
at Composer.compose (/node/node_modules/yaml/dist/compose/composer.js:131:25)
at compose.next (<anonymous>)
at Function.from (<anonymous>)
at Object.parseAllDocuments (/node/node_modules/yaml/dist/public-api.js:28:24)
at Object.<anonymous> (/yaml/bin/js-yaml-json:7:19) {
code: 'UNEXPECTED_TOKEN',
pos: [ 11, 43 ],
linePos: [ { line: 2, col: 1 }, { line: 2, col: 33 } ]
}
Node.js v20.13.1
invalid_correct
/tmp/NimYAML-0.16.0/yaml/stream.nim(134) nimyaml_event
/tmp/NimYAML-0.16.0/yaml/stream.nim(106) next
Error: unhandled exception: Unexpected token (expected document end): Indentation [YamlStreamError]
+STR
+DOC
=VAL <!foo> "bar
invalid_correct
Line : 2
Column : 1
Expected : DOC_END DOC_START EOL
Got : TAG_DIRECTIVE
Where : /perl5/lib/perl5/YAML/PP/Parser.pm line 392
YAML : "%TAG ! tag:example.com,2000:app/"
at /yaml/bin/perl-pp-event line 46.
+STR
+DOC
=VAL <!foo> "bar
invalid_correct
Line : 2
Column : 1
Expected : DOC_END DOC_START EOL
Got : TAG_DIRECTIVE
Where : /perl5/lib/perl5/YAML/PP/Parser.pm line 392
YAML : "%TAG ! tag:example.com,2000:app/"
at /perl5/lib/perl5/YAML/PP/Loader.pm line 94.
invalid_correct
Line : 2
Column : 1
Expected : DOC_END DOC_START EOL
Got : TAG_DIRECTIVE
Where : /perl5/lib/perl5/YAML/PP/Parser.pm line 392
YAML : "%TAG ! tag:example.com,2000:app/"
at /perl5/lib/perl5/YAML/PP/Loader.pm line 94.
invalid_correct
Parser finished before end of input at /perl5/lib/perl5/YAML/Parser.pm line 4056, <> line 1.
invalid_correct
Syck parser (line 5, column -1): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.
invalid_correct
Syck parser (line 5, column -1): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.
invalid_correct
YAML::Tiny failed to classify line '!foo "bar"' at /yaml/bin/perl-tiny-json line 12.
invalid_correct
YAML::Tiny failed to classify line '!foo "bar"' at /yaml/bin/perl-tiny-perl line 15.
invalid_correct
YAML::XS Error: bad tag found for scalar: 'tag:example.com,2000:app/foo' at /yaml/bin/perl-xs-json line 14, <> line 1.
invalid_correct
YAML::XS Error: bad tag found for scalar: 'tag:example.com,2000:app/foo' at /yaml/bin/perl-xs-perl line 16, <> line 1.
invalid_correct
YAML Error: Expected separator '---'
Code: YAML_PARSE_ERR_NO_SEPARATOR
Line: 1
Document: 2
at /perl5/lib/perl5/YAML/Loader.pm line 88.
invalid_correct
YAML Error: Expected separator '---'
Code: YAML_PARSE_ERR_NO_SEPARATOR
Line: 1
Document: 2
at /perl5/lib/perl5/YAML/Loader.pm line 88.