--- &test-MUS6:01
Title: Directive variants
Tags: [ directive ]
%YAML 1.2
---
%YAML 1.2
---
invalid_incorrect
+STR
+DOC ---
=VAL :
-DOC
+DOC ---
=VAL :
-DOC
-STR
invalid_incorrect
+STR
+DOC ---
=VAL :
-DOC
+DOC ---
=VAL :
-DOC
-STR
invalid_incorrect
+STR
+DOC
=VAL :
-DOC
+DOC
=VAL :
-DOC
-STR
invalid_incorrect
Line Col Char Byte Token|Content
1 0 0 0 +DOC |
1 0 0 0 +DIR |
1 0 0 0 =SYNX|%
1 1 1 1 =META|YAML
1 5 5 5 =WSPC|.
1 6 6 6 =META|1.2
1 9 9 9 -DIR |
1 9 9 9 =EOL |\x0a
2 0 10 10 =HEAD|---
2 3 13 13 +NODE|
2 3 13 13 +VAL |
2 3 13 13 -VAL |
2 3 13 13 -NODE|
2 3 13 13 =EOL |\x0a
3 0 14 14 =REST|%YAML.1.2
3 9 23 23 =REST|\x0a
4 0 24 24 -DOC |
4 0 24 24 +DOC |
4 0 24 24 =HEAD|---
4 3 27 27 +NODE|
4 3 27 27 +VAL |
4 3 27 27 -VAL |
4 3 27 27 -NODE|
4 3 27 27 =EOL |\x0a
5 0 28 28 -DOC |
invalid_incorrect
+STR
+DOC ---
=VAL :%YAML 1.2
-DOC
+DOC ---
=VAL :
-DOC
-STR
invalid_incorrect
null
null
invalid_incorrect
undef
undef
invalid_incorrect
"%YAML 1.2 --- %YAML 1.2 ---"
invalid_incorrect
'%YAML 1.2 --- %YAML 1.2 ---'
invalid_incorrect
null
null
invalid_incorrect
undef
undef
invalid_incorrect
+STR
+DOC ---
=VAL :
-DOC
+DOC ---
=VAL :
-DOC
-STR
invalid_incorrect
null
null
invalid_incorrect
None
None
invalid_incorrect
+STR
+DOC ---
=VAL :
-DOC
+DOC ---
=VAL :
-DOC
-STR
invalid_incorrect
null
null
invalid_incorrect
None
None
invalid_incorrect
null
null
invalid_incorrect
+STR
+DOC
=VAL :
-DOC
+DOC
=VAL :
-DOC
-STR
invalid_correct
stdin:3:7: error: missing explicit document end marker before directive(s)
%YAML 1.2
^~~
+STR
+DOC ---
=VAL :
invalid_correct
stdin:3:7: error: missing explicit document end marker before directive(s)
%YAML 1.2
^~~
invalid_correct
Unhandled exception. YamlDotNet.Core.SyntaxErrorException: (Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 1, Idx: 0): While parsing a document start node, could not find document end marker before version directive.
at YamlDotNet.Core.Parser.ParseDocumentStart(Boolean isImplicit)
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 :
-DOC
invalid_correct
Unhandled exception. YamlDotNet.Core.SyntaxErrorException: (Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 1, Idx: 0): While parsing a document start node, could not find document end marker before version directive.
at YamlDotNet.Core.Parser.ParseDocumentStart(Boolean isImplicit)
at YamlDotNet.Core.Parser.StateMachine()
at YamlDotNet.Core.Parser.MoveNext()
at YamlDotNet.Core.ParserExtensions.Consume[T](IParser parser)
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: found incompatible YAML document
invalid_correct
Parsing error near byte offset Pos {posByteOffset = 14, posCharOffset = 14, posLine = 3, posColumn = 0} (Lexical error near "%YAML 1.2")
+STR
+DOC ---
=VAL :
invalid_correct
hsyaml-parser: user error (Lexical error near "%YAML 1.2")
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 | %YAML 1.2
2 | ---
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: '%YAML 1.2\n---\n%YAML 1.2\n---\n',
position: 14,
line: 2,
column: 0,
snippet: ' 1 | %YAML 1.2\n 2 | ---\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:
---
%YAML 1.2
^
+STR
+DOC ---
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:
---
%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 Object.composeNode (/node/node_modules/yaml/dist/compose/compose-node.js:24:34)
at Object.composeDoc (/node/node_modules/yaml/dist/compose/compose-doc.js:34:23)
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) {
code: 'BAD_SCALAR_START',
pos: [ 14, 15 ],
linePos: [ { line: 3, col: 1 }, { line: 3, col: 2 } ]
}
Node.js v20.13.1
invalid_correct
Line : 3
Column : 1
Expected : ALIAS BLOCK_SCALAR COLON DOC_END DOC_START EOL FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUESTION QUOTED QUOTED_MULTILINE WS
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 ---
invalid_correct
Line : 3
Column : 1
Expected : ALIAS BLOCK_SCALAR COLON DOC_END DOC_START EOL FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUESTION QUOTED QUOTED_MULTILINE WS
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 BLOCK_SCALAR COLON DOC_END DOC_START EOL FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUESTION QUOTED QUOTED_MULTILINE WS
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
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
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.