--- &test-RHX7
Title: YAML directive without document end marker
Tags: [ directive, error ]
---
key: value
%YAML 1.2
---
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
invalid_incorrect
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
+DOC ---
=VAL :
-DOC
-STR
invalid_incorrect
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
=VAL :%YAML 1.2
=VAL :
-MAP
-DOC
+DOC ---
=VAL :
-DOC
-STR
invalid_incorrect
+STR
+DOC
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
+DOC
=VAL :
-DOC
-STR
invalid_incorrect
Line Col Char Byte Token|Content
1 0 0 0 +DOC |
1 0 0 0 =HEAD|---
1 3 3 3 +NODE|
1 3 3 3 =EOL |\x0a
2 0 4 4 +MAP |
2 0 4 4 +PAIR|
2 0 4 4 +NODE|
2 0 4 4 +VAL |
2 0 4 4 =TEXT|key
2 3 7 7 -VAL |
2 3 7 7 -NODE|
2 3 7 7 =SYNX|:
2 4 8 8 =WSPC|.
2 5 9 9 +NODE|
2 5 9 9 +VAL |
2 5 9 9 =TEXT|value
2 10 14 14 -VAL |
2 10 14 14 -NODE|
2 10 14 14 =EOL |\x0a
3 0 15 15 -PAIR|
3 0 15 15 -MAP |
3 0 15 15 -NODE|
3 0 15 15 -DOC |
3 0 15 15 =ERR |Unexpected.'%'
invalid_incorrect
{"key":"value"}
{}
invalid_incorrect
{
"key" : "value"
}
null
invalid_incorrect
{
'key' => 'value'
}
undef
invalid_incorrect
{
"key" : "value"
}
null
invalid_incorrect
{
'key' => 'value'
}
undef
invalid_incorrect
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
+DOC ---
=VAL :
-DOC
-STR
invalid_incorrect
{
"key": "value"
}
null
invalid_incorrect
{'key': 'value'}
None
invalid_incorrect
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
+DOC ---
=VAL :
-DOC
-STR
invalid_incorrect
{
"key": "value"
}
null
invalid_incorrect
{'key': 'value'}
None
invalid_incorrect
{"key":"value"}
null
invalid_incorrect
+STR
+DOC
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
+DOC
=VAL :
-DOC
-STR
invalid_correct
stdin:3:7: error: missing explicit document end marker before directive(s)
%YAML 1.2
^~~
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
-MAP
invalid_correct
stdin:3:7: error: missing explicit document end marker before directive(s)
%YAML 1.2
^~~
invalid_correct
Unhandled exception. YamlDotNet.Core.SemanticErrorException: (Line: 3, Col: 1, Idx: 15) - (Line: 3, Col: 6, Idx: 20): While scanning a version directive, did not find preceding <document end>.
at YamlDotNet.Core.Scanner.ScanDirective()
at YamlDotNet.Core.Scanner.FetchDirective()
at YamlDotNet.Core.Scanner.FetchNextToken()
at YamlDotNet.Core.Scanner.FetchMoreTokens()
at YamlDotNet.Core.Scanner.MoveNextWithoutConsuming()
at YamlDotNet.Core.Parser.GetCurrentToken()
at YamlDotNet.Core.Parser.ParseBlockMappingKey(Boolean isFirst)
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 ---
+MAP
=VAL :key
=VAL :value
invalid_correct
Unhandled exception. YamlDotNet.Core.SemanticErrorException: (Line: 3, Col: 1, Idx: 15) - (Line: 3, Col: 6, Idx: 20): While scanning a version directive, did not find preceding <document end>.
at YamlDotNet.Core.Scanner.ScanDirective()
at YamlDotNet.Core.Scanner.FetchDirective()
at YamlDotNet.Core.Scanner.FetchNextToken()
at YamlDotNet.Core.Scanner.FetchMoreTokens()
at YamlDotNet.Core.Scanner.MoveNextWithoutConsuming()
at YamlDotNet.Core.Parser.GetCurrentToken()
at YamlDotNet.Core.Parser.ParseBlockMappingKey(Boolean isFirst)
at YamlDotNet.Core.Parser.StateMachine()
at YamlDotNet.Core.Parser.MoveNext()
at YamlDotNet.Core.ParserExtensions.TryConsume[T](IParser parser, T& event)
at YamlDotNet.Serialization.NodeDeserializers.ScalarNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize(IParser parser, Type expectedType, Func`3 nestedObjectDeserializer, Object& value)
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.ValueDeserializers.NodeValueDeserializer.<>c__DisplayClass3_0.<DeserializeValue>b__0(IParser r, Type t)
at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.DeserializeHelper(Type tKey, Type tValue, IParser parser, Func`3 nestedObjectDeserializer, IDictionary result)
at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize(IParser parser, Type expectedType, Func`3 nestedObjectDeserializer, Object& value)
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
yaml: line 2: found incompatible YAML document
{"key":"value"}
invalid_correct
Parsing error near byte offset Pos {posByteOffset = 15, posCharOffset = 15, posLine = 3, posColumn = 0} (Unexpected '%')
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
invalid_correct
hsyaml-parser: user error (Unexpected '%')
invalid_correct
/node/node_modules/js-yaml/lib/loader.js:187
throw generateError(state, message);
^
YAMLException: end of the stream or a document separator is expected (3:1)
1 | ---
2 | key: value
3 | %YAML 1.2
-----^
4 | ---
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 readDocument (/node/node_modules/js-yaml/lib/loader.js:1645:5)
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)
at Module._load (node:internal/modules/cjs/loader:1024:12) {
reason: 'end of the stream or a document separator is expected',
mark: {
name: null,
buffer: '---\nkey: value\n%YAML 1.2\n---\n',
position: 15,
line: 2,
column: 0,
snippet: ' 1 | ---\n 2 | key: value\n 3 | %YAML 1.2\n-----^\n 4 | ---'
}
}
Node.js v20.13.1
invalid_correct
Plain value cannot start with directive indicator character % at line 3, column 1:
key: value
%YAML 1.2
^
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
invalid_correct
/yaml/bin/js-yaml-json:9
if (doc.errors.length !== 0) throw doc.errors[0]
^
YAMLParseError: Plain value cannot start with directive indicator character % at line 3, column 1:
key: value
%YAML 1.2
^
at Composer.onError (/node/node_modules/yaml/dist/compose/composer.js:69:34)
at _onError (/node/node_modules/yaml/dist/compose/resolve-flow-scalar.js:10:42)
at plainValue (/node/node_modules/yaml/dist/compose/resolve-flow-scalar.js:68:9)
at Object.resolveFlowScalar (/node/node_modules/yaml/dist/compose/resolve-flow-scalar.js:14:21)
at Object.composeScalar (/node/node_modules/yaml/dist/compose/compose-scalar.js:11:29)
at composeNode (/node/node_modules/yaml/dist/compose/compose-node.js:24:34)
at Object.resolveBlockMap (/node/node_modules/yaml/dist/compose/resolve-block-map.js:57:15)
at resolveCollection (/node/node_modules/yaml/dist/compose/compose-collection.js:13:27)
at Object.composeCollection (/node/node_modules/yaml/dist/compose/compose-collection.js:47:16)
at Object.composeNode (/node/node_modules/yaml/dist/compose/compose-node.js:31:38) {
code: 'BAD_SCALAR_START',
pos: [ 15, 16 ],
linePos: [ { line: 3, col: 1 }, { line: 3, col: 2 } ]
}
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 ':'): DirectivesEnd [YamlStreamError]
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
=VAL :%YAML 1.2
invalid_correct
Line : 3
Column : 1
Expected : ALIAS COLON DOC_END DOC_START EOL PLAIN QUESTION QUOTED
Got : YAML_DIRECTIVE
Where : /perl5/lib/perl5/YAML/PP/Parser.pm line 392
YAML : "%YAML 1.2"
at /yaml/bin/perl-pp-event line 46.
+STR
+DOC ---
+MAP
=VAL :key
=VAL :value
invalid_correct
Line : 3
Column : 1
Expected : ALIAS COLON DOC_END DOC_START EOL PLAIN QUESTION QUOTED
Got : YAML_DIRECTIVE
Where : /perl5/lib/perl5/YAML/PP/Parser.pm line 392
YAML : "%YAML 1.2"
at /perl5/lib/perl5/YAML/PP/Loader.pm line 94.
invalid_correct
Line : 3
Column : 1
Expected : ALIAS COLON DOC_END DOC_START EOL PLAIN QUESTION QUOTED
Got : YAML_DIRECTIVE
Where : /perl5/lib/perl5/YAML/PP/Parser.pm line 392
YAML : "%YAML 1.2"
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 4, column 0): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.
invalid_correct
Syck parser (line 4, column 0): 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 '%YAML 1.2' at /yaml/bin/perl-tiny-json line 12.
invalid_correct
YAML::Tiny failed to classify line '%YAML 1.2' at /yaml/bin/perl-tiny-perl line 15.
invalid_correct
Use of uninitialized value in sprintf at /perl5/lib/perl5/YAML/Error.pm line 18, <> line 1.
YAML Error: Can't parse inline implicit value ''
Code: YAML_PARSE_ERR_BAD_INLINE_IMPLICIT
Line: 3
Document: 1
at /perl5/lib/perl5/YAML/Loader.pm line 607.
invalid_correct
Use of uninitialized value in sprintf at /perl5/lib/perl5/YAML/Error.pm line 18, <> line 1.
YAML Error: Can't parse inline implicit value ''
Code: YAML_PARSE_ERR_BAD_INLINE_IMPLICIT
Line: 3
Document: 1
at /perl5/lib/perl5/YAML/Loader.pm line 607.