| YAML::PP::Highlight | YAML::PP::Loader | Data::Dump | YAML::PP::Loader | JSON::XS | YAML::PP::Loader | YAML::PP::Dumper | YAML::PP::Parser | YAML::PP::Emitter | |
| 229Q - Spec Example 2.4. Sequence of Mappings | |||||
| Tags: mapping, sequence, spec View source |
- name: Mark McGwire hr: 65 avg: 0.278 - name: Sammy Sosa hr: 63 avg: 0.288 |
$doc1 = [
{ avg => 0.278, hr => 65, name => "Mark McGwire" },
{ avg => 0.288, hr => 63, name => "Sammy Sosa" },
]
|
Doc 1: [
{
"avg" : 0.278,
"hr" : 65,
"name" : "Mark McGwire"
},
{
"avg" : 0.288,
"hr" : 63,
"name" : "Sammy Sosa"
}
]
|
--- - avg: 0.278 hr: 65 name: Mark McGwire - avg: 0.288 hr: 63 name: Sammy Sosa |
- name: Mark McGwire hr: 65 avg: 0.278 - name: Sammy Sosa hr: 63 avg: 0.288 |
| 26DV - Whitespace around colon in mappings | |||||
| Tags: alias, mapping, whitespace View source |
"top1" : "key1" : &alias1 scalar1 'top2' : 'key2' : &alias2 scalar2 top3: &node3 *alias1 : scalar3 top4: *alias2 : scalar4 top5 : scalar5 top6: &anchor6 'key6' : scalar6 |
$doc1 = {
top1 => { key1 => "scalar1" },
top2 => { key2 => "scalar2" },
top3 => { scalar1 => "scalar3" },
top4 => { scalar2 => "scalar4" },
top5 => "scalar5",
top6 => { key6 => "scalar6" },
}
|
Doc 1: {
"top1" : {
"key1" : "scalar1"
},
"top2" : {
"key2" : "scalar2"
},
"top3" : {
"scalar1" : "scalar3"
},
"top4" : {
"scalar2" : "scalar4"
},
"top5" : "scalar5",
"top6" : {
"key6" : "scalar6"
}
}
|
--- top1: key1: scalar1 top2: key2: scalar2 top3: scalar1: scalar3 top4: scalar2: scalar4 top5: scalar5 top6: key6: scalar6 |
"top1": "key1": &alias1 scalar1 'top2': 'key2': &alias2 scalar2 top3: &node3 *alias1 : scalar3 top4: *alias2 : scalar4 top5: scalar5 top6: &anchor6 'key6': scalar6 |
| 27NA - Spec Example 5.9. Directive Indicator | |||||
| Tags: 1.3-err, directive, spec View source |
%YAML 1.2 --- text |
$doc1 = "text" |
Doc 1: "text" |
--- text |
%YAML 1.2 --- text |
| 2AUY - Tags in Block Sequence | |||||
| Tags: sequence, tag View source |
- !!str a - b - !!int 42 - d |
$doc1 = ["a", "b", 42, "d"] |
Doc 1: [ "a", "b", 42, "d" ] |
--- - a - b - 42 - d |
- !!str a - b - !!int 42 - d |
| 2EBW - Allowed characters in keys | |||||
| Tags: mapping, scalar View source |
a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~: safe ?foo: safe question mark :foo: safe colon -foo: safe dash this is#not: a comment |
$doc1 = {
"-foo" => "safe dash",
":foo" => "safe colon",
"?foo" => "safe question mark",
"a!\"#\$%&'()*+,-./09:;<=>?\@AZ[\\]^_`az{|}~" => "safe",
"this is#not" => "a comment",
}
|
Doc 1: {
"-foo" : "safe dash",
":foo" : "safe colon",
"?foo" : "safe question mark",
"a!\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~" : "safe",
"this is#not" : "a comment"
}
|
--- -foo: safe dash :foo: safe colon ?foo: safe question mark a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~: safe this is#not: a comment |
a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~: safe ?foo: safe question mark :foo: safe colon -foo: safe dash this is#not: a comment |
| 2G84/02 - Literal modifers | |||||
| Tags: View source |
--- |1- |
$doc1 = "" |
Doc 1: "" |
--- '' |
--- "" |
| 2G84/03 - Literal modifers | |||||
| Tags: View source |
--- |1+ |
$doc1 = "" |
Doc 1: "" |
--- '' |
--- "" |
| 2JQS - Block Mapping with Missing Keys | |||||
| Tags: duplicate-key, empty-key, mapping View source |
: a : b Duplicate key '' at YAML/PP/Parser.pm line 61. at YAML/PP/Loader.pm line 94. |
: a : b |
|||
| 2LFX - Spec Example 6.13. Reserved Directives [1.3] | |||||
| Tags: 1.3-mod, directive, double, header, spec View source |
%FOO bar baz # Should be ignored # with a warning. --- "foo" |
$doc1 = "foo" |
Doc 1: "foo" |
--- foo |
--- "foo" |
| 2SXE - Anchors With Colon in Name | |||||
| Tags: 1.3-err, alias, edge, mapping View source |
&a: key: &a value foo: *a: |
$doc1 = { foo => "key", key => "value" }
|
Doc 1: {
"foo" : "key",
"key" : "value"
}
|
--- foo: key key: value |
&a: key: &a value foo: *a: |
| 2XXW - Spec Example 2.25. Unordered Sets | |||||
| Tags: explicit-key, mapping, spec, unknown-tag View source |
# Sets are represented as a # Mapping where each key is # associated with a null value --- !!set ? Mark McGwire ? Sammy Sosa ? Ken Griff |
$doc1 = { "Ken Griff" => undef, "Mark McGwire" => undef, "Sammy Sosa" => undef }
|
Doc 1: {
"Ken Griff" : null,
"Mark McGwire" : null,
"Sammy Sosa" : null
}
|
--- Ken Griff: null Mark McGwire: null Sammy Sosa: null |
--- !!set Mark McGwire: Sammy Sosa: Ken Griff: |
| 33X3 - Three explicit integers in a block sequence | |||||
| Tags: sequence, tag View source |
--- - !!int 1 - !!int -2 - !!int 33 |
$doc1 = [1, -2, 33] |
Doc 1: [ 1, -2, 33 ] |
--- - 1 - -2 - 33 |
--- - !!int 1 - !!int -2 - !!int 33 |
| 35KP - Tags for Root Objects | |||||
| Tags: explicit-key, header, mapping, tag View source |
--- !!map ? a : b --- !!seq - !!str c --- !!str d e |
$doc1 = { a => "b" }
$doc2 = ["c"]
$doc3 = "d e"
|
Doc 1: {
"a" : "b"
}
Doc 2: [
"c"
]
Doc 3: "d e"
|
--- a: b --- - c --- d e |
--- !!map a: b --- !!seq - !!str c --- !!str d e |
| 36F6 - Multiline plain scalar with empty line | |||||
| Tags: mapping, scalar View source |
--- plain: a b c |
$doc1 = { plain => "a b\nc" }
|
Doc 1: {
"plain" : "a b\nc"
}
|
--- plain: |- a b c |
--- plain: |- a b c |
| 3ALJ - Block Sequence in Block Sequence | |||||
| Tags: sequence View source |
- - s1_i1 - s1_i2 - s2 |
$doc1 = [["s1_i1", "s1_i2"], "s2"] |
Doc 1: [
[
"s1_i1",
"s1_i2"
],
"s2"
]
|
--- - - s1_i1 - s1_i2 - s2 |
- - s1_i1 - s1_i2 - s2 |
| 3GZX - Spec Example 7.1. Alias Nodes | |||||
| Tags: alias, mapping, spec View source |
First occurrence: &anchor Foo Second occurrence: *anchor Override anchor: &anchor Bar Reuse anchor: *anchor |
$doc1 = {
"First occurrence" => "Foo",
"Override anchor" => "Bar",
"Reuse anchor" => "Bar",
"Second occurrence" => "Foo",
}
|
Doc 1: {
"First occurrence" : "Foo",
"Override anchor" : "Bar",
"Reuse anchor" : "Bar",
"Second occurrence" : "Foo"
}
|
--- First occurrence: Foo Override anchor: Bar Reuse anchor: Bar Second occurrence: Foo |
First occurrence: &anchor Foo Second occurrence: *anchor Override anchor: &anchor Bar Reuse anchor: *anchor |
| 3MYT - Plain Scalar looking like key, comment, anchor and tag | |||||
| Tags: scalar View source |
--- k:#foo &a !t s |
$doc1 = "k:#foo &a !t s" |
Doc 1: "k:#foo &a !t s" |
--- k:#foo &a !t s |
--- k:#foo &a !t s |
| 3R3P - Single block sequence with anchor | |||||
| Tags: anchor, sequence View source |
&sequence - a |
$doc1 = ["a"] |
Doc 1: [ "a" ] |
--- - a |
&sequence - a |
| 3RLN/00 - Leading tabs in double quoted | |||||
| Tags: View source |
"1 leading \ttab" |
$doc1 = "1 leading \ttab" |
Doc 1: "1 leading \ttab" |
--- "1 leading \ttab" |
"1 leading \ttab" |
| 3RLN/01 - Leading tabs in double quoted | |||||
| Tags: View source |
"2 leading \ tab" |
$doc1 = "2 leading \ttab" |
Doc 1: "2 leading \ttab" |
--- "2 leading \ttab" |
"2 leading \ttab" |
| 3RLN/02 - Leading tabs in double quoted | |||||
| Tags: View source |
"3 leading tab" |
$doc1 = "3 leading tab" |
Doc 1: "3 leading tab" |
--- 3 leading tab |
"3 leading tab" |
| 3RLN/03 - Leading tabs in double quoted | |||||
| Tags: View source |
"4 leading \t tab" |
$doc1 = "4 leading \t tab" |
Doc 1: "4 leading \t tab" |
--- "4 leading \t tab" |
"4 leading \t tab" |
| 3RLN/04 - Leading tabs in double quoted | |||||
| Tags: View source |
"5 leading \ tab" |
$doc1 = "5 leading \t tab" |
Doc 1: "5 leading \t tab" |
--- "5 leading \t tab" |
"5 leading \t tab" |
| 3RLN/05 - Leading tabs in double quoted | |||||
| Tags: View source |
"6 leading tab" |
$doc1 = "6 leading tab" |
Doc 1: "6 leading tab" |
--- 6 leading tab |
"6 leading tab" |
| 3UYS - Escaped slash in double quotes | |||||
| Tags: double View source |
escaped slash: "a\/b" |
$doc1 = { "escaped slash" => "a/b" }
|
Doc 1: {
"escaped slash" : "a/b"
}
|
--- escaped slash: a/b |
escaped slash: "a/b" |
| 4ABK - Flow Mapping Separate Values | |||||
| Tags: flow, mapping View source |
{ unquoted : "separate", http://foo.com, omitted value:, } |
$doc1 = {
"http://foo.com" => undef,
"omitted value" => undef,
"unquoted" => "separate",
}
|
Doc 1: {
"http://foo.com" : null,
"omitted value" : null,
"unquoted" : "separate"
}
|
--- http://foo.com: null omitted value: null unquoted: separate |
{unquoted: "separate", http://foo.com: , omitted value: } |
| 4CQQ - Spec Example 2.18. Multi-line Flow Scalars | |||||
| Tags: scalar, spec View source |
plain: This unquoted scalar spans many lines. quoted: "So does this quoted scalar.\n" |
$doc1 = {
plain => "This unquoted scalar spans many lines.",
quoted => "So does this quoted scalar.\n",
}
|
Doc 1: {
"plain" : "This unquoted scalar spans many lines.",
"quoted" : "So does this quoted scalar.\n"
}
|
--- plain: This unquoted scalar spans many lines. quoted: | So does this quoted scalar. |
plain: This unquoted scalar spans many lines. quoted: "So does this quoted scalar.\n" |
| 4FJ6 - Nested implicit complex keys | |||||
| Tags: complex-key, flow, mapping, sequence View source |
--- [ [ a, [ [[b,c]]: d, e]]: 23 ] Line : 3 Column : 17 Expected : EOL FLOWSEQ_END FLOW_COMMA WS Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ": d, e]]: 23\n" at YAML/PP/Loader.pm line 94. |
||||
| 4GC6 - Spec Example 7.7. Single Quoted Characters | |||||
| Tags: 1.3-err, scalar, spec View source |
'here''s to "quotes"' |
$doc1 = "here's to \"quotes\"" |
Doc 1: "here's to \"quotes\"" |
--- here's to "quotes" |
'here''s to "quotes"' |
| 4MUZ/00 - Flow mapping colon on line after key | |||||
| Tags: View source |
{"foo" : "bar"} |
$doc1 = { foo => "bar" }
|
Doc 1: {
"foo" : "bar"
}
|
--- foo: bar |
{"foo": "bar"} |
| 4MUZ/01 - Flow mapping colon on line after key | |||||
| Tags: View source |
{"foo" : bar} |
$doc1 = { foo => "bar" }
|
Doc 1: {
"foo" : "bar"
}
|
--- foo: bar |
{"foo": bar} |
| 4MUZ/02 - Flow mapping colon on line after key | |||||
| Tags: View source |
{foo : bar} |
$doc1 = { foo => "bar" }
|
Doc 1: {
"foo" : "bar"
}
|
--- foo: bar |
{foo: bar} |
| 4Q9F - Folded Block Scalar [1.3] | |||||
| Tags: 1.3-mod, folded, scalar, whitespace View source |
--- > ab cd ef gh |
$doc1 = "ab cd\nef\n\ngh\n" |
Doc 1: "ab cd\nef\n\ngh\n" |
--- | ab cd ef gh |
--- > ab cd ef gh |
| 4QFQ - Spec Example 8.2. Block Indentation Indicator [1.3] | |||||
| Tags: 1.3-mod, folded, libyaml-err, literal, scalar, spec, whitespace View source |
- | detected - > # detected - |1 explicit - > detected |
$doc1 = ["detected\n", "\n\n# detected\n", " explicit\n", "detected\n"] |
Doc 1: [ "detected\n", "\n\n# detected\n", " explicit\n", "detected\n" ] |
--- - | detected - | # detected - |2 explicit - | detected |
- | detected - > # detected - |2 explicit - > detected |
| 4RWC - Trailing spaces after flow collection | |||||
| Tags: flow, whitespace View source |
[1, 2, 3] |
$doc1 = [1, 2, 3] |
Doc 1: [ 1, 2, 3 ] |
--- - 1 - 2 - 3 |
- 1 - 2 - 3 |
| 4UYU - Colon in Double Quoted String | |||||
| Tags: 1.3-err, mapping, scalar View source |
"foo: bar\": baz" |
$doc1 = "foo: bar\": baz" |
Doc 1: "foo: bar\": baz" |
--- 'foo: bar": baz' |
"foo: bar\": baz" |
| 4V8U - Plain scalar with backslashes | |||||
| Tags: scalar View source |
--- plain\value\with\backslashes |
$doc1 = "plain\\value\\with\\backslashes" |
Doc 1: "plain\\value\\with\\backslashes" |
--- plain\value\with\backslashes |
--- plain\value\with\backslashes |
| 4WA9 - Literal scalars | |||||
| Tags: indent, literal View source |
- aaa: |2 xxx bbb: | xxx |
$doc1 = [{ aaa => "xxx\n", bbb => "xxx\n" }]
|
Doc 1: [
{
"aaa" : "xxx\n",
"bbb" : "xxx\n"
}
]
|
--- - aaa: | xxx bbb: | xxx |
- aaa: | xxx bbb: | xxx |
| 4ZYM - Spec Example 6.4. Line Prefixes | |||||
| Tags: double, literal, scalar, spec, upto-1.2, whitespace View source |
plain: text lines quoted: "text lines" block: | text lines |
$doc1 = {
block => "text\n \tlines\n",
plain => "text lines",
quoted => "text lines",
}
|
Doc 1: {
"block" : "text\n \tlines\n",
"plain" : "text lines",
"quoted" : "text lines"
}
|
--- block: "text\n \tlines\n" plain: text lines quoted: text lines |
plain: text lines quoted: "text lines" block: | text lines |
| 52DL - Explicit Non-Specific Tag [1.3] | |||||
| Tags: 1.3-mod, tag View source |
--- ! a |
$doc1 = "a" |
Doc 1: "a" |
--- a |
--- ! a |
| 54T7 - Flow Mapping | |||||
| Tags: flow, mapping View source |
{foo: you, bar: far} |
$doc1 = { bar => "far", foo => "you" }
|
Doc 1: {
"bar" : "far",
"foo" : "you"
}
|
--- bar: far foo: you |
{foo: you, bar: far} |
| 565N - Construct Binary | |||||
| Tags: tag, unknown-tag View source |
canonical: !!binary "\ R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\ OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\ +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\ AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=" generic: !!binary | R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= description: The binary value above is a tiny arrow encoded as a gif image. |
$doc1 = {
canonical => "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=",
description => "The binary value above is a tiny arrow encoded as a gif image.",
generic => "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\nOTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\n+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\nAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=\n",
}
|
Doc 1: {
"canonical" : "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=",
"description" : "The binary value above is a tiny arrow encoded as a gif image.",
"generic" : "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\nOTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\n+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\nAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=\n"
}
|
--- canonical: R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= description: The binary value above is a tiny arrow encoded as a gif image. generic: | R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= |
canonical: !!binary "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=" generic: !!binary | R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= description: The binary value above is a tiny arrow encoded as a gif image. |
| 57H4 - Spec Example 8.22. Block Collection Nodes | |||||
| Tags: mapping, sequence, tag View source |
sequence: !!seq - entry - !!seq - nested mapping: !!map foo: bar |
$doc1 = { mapping => { foo => "bar" }, sequence => ["entry", ["nested"]] }
|
Doc 1: {
"mapping" : {
"foo" : "bar"
},
"sequence" : [
"entry",
[
"nested"
]
]
}
|
--- mapping: foo: bar sequence: - entry - - nested |
sequence: !!seq - entry - !!seq - nested mapping: !!map foo: bar |
| 58MP - Flow mapping edge cases | |||||
| Tags: edge, flow, mapping View source |
{x: :x} |
$doc1 = { x => ":x" }
|
Doc 1: {
"x" : ":x"
}
|
--- x: :x |
{x: :x} |
| 5BVJ - Spec Example 5.7. Block Scalar Indicators | |||||
| Tags: folded, literal, scalar, spec View source |
literal: | some text folded: > some text |
$doc1 = { folded => "some text\n", literal => "some\ntext\n" }
|
Doc 1: {
"folded" : "some text\n",
"literal" : "some\ntext\n"
}
|
--- folded: | some text literal: | some text |
literal: | some text folded: > some text |
| 5C5M - Spec Example 7.15. Flow Mappings | |||||
| Tags: flow, mapping, spec View source |
- { one : two , three: four , } - {five: six,seven : eight} |
$doc1 = [
{ one => "two", three => "four" },
{ five => "six", seven => "eight" },
]
|
Doc 1: [
{
"one" : "two",
"three" : "four"
},
{
"five" : "six",
"seven" : "eight"
}
]
|
--- - one: two three: four - five: six seven: eight |
- {one: two, three: four} - {five: six, seven: eight} |
| 5GBF - Spec Example 6.5. Empty Lines | |||||
| Tags: double, literal, scalar, spec, upto-1.2, whitespace View source |
Folding: "Empty line as a line feed" Chomping: | Clipped empty lines |
$doc1 = {
Chomping => "Clipped empty lines\n",
Folding => "Empty line\nas a line feed",
}
|
Doc 1: {
"Chomping" : "Clipped empty lines\n",
"Folding" : "Empty line\nas a line feed"
}
|
--- Chomping: | Clipped empty lines Folding: |- Empty line as a line feed |
Folding: "Empty line\nas a line feed" Chomping: | Clipped empty lines |
| 5KJE - Spec Example 7.13. Flow Sequence | |||||
| Tags: flow, sequence, spec View source |
- [ one, two, ] - [three ,four] |
$doc1 = [["one", "two"], ["three", "four"]] |
Doc 1: [
[
"one",
"two"
],
[
"three",
"four"
]
]
|
--- - - one - two - - three - four |
- - one - two - - three - four |
| 5MUD - Colon and adjacent value on next line | |||||
| Tags: double, flow, mapping View source |
--- { "foo" :bar } |
$doc1 = { foo => "bar" }
|
Doc 1: {
"foo" : "bar"
}
|
--- foo: bar |
--- {"foo": bar} |
| 5NYZ - Spec Example 6.9. Separated Comment | |||||
| Tags: comment, mapping, spec View source |
key: # Comment value |
$doc1 = { key => "value" }
|
Doc 1: {
"key" : "value"
}
|
--- key: value |
key: value |
| 5T43 - Colon at the beginning of adjacent flow scalar | |||||
| Tags: flow, mapping, scalar View source |
- { "key":value } - { "key"::value } |
$doc1 = [{ key => "value" }, { key => ":value" }]
|
Doc 1: [
{
"key" : "value"
},
{
"key" : ":value"
}
]
|
--- - key: value - key: :value |
- {"key": value} - {"key": :value} |
| 5TYM - Spec Example 6.21. Local Tag Prefix | |||||
| Tags: directive, local-tag, spec, tag View source |
%TAG !m! !my- --- # Bulb here !m!light fluorescent ... %TAG !m! !my- --- # Color here !m!light green |
$doc1 = "fluorescent" $doc2 = "green" |
Doc 1: "fluorescent" Doc 2: "green" |
--- fluorescent --- green |
--- !my-light fluorescent ... --- !my-light green |
| 5WE3 - Spec Example 8.17. Explicit Block Mapping Entries | |||||
| Tags: comment, explicit-key, literal, mapping, sequence, spec View source |
? explicit key # Empty value ? | block key : - one # Explicit compact - two # block value |
$doc1 = { "block key\n" => ["one", "two"], "explicit key" => undef }
|
Doc 1: {
"block key\n" : [
"one",
"two"
],
"explicit key" : null
}
|
--- ? | block key : - one - two explicit key: null |
explicit key: ? | block key : - one - two |
| 652Z - Question mark at start of flow key | |||||
| Tags: flow View source |
{ ?foo: bar, bar: 42 } |
$doc1 = { "?foo" => "bar", "bar" => 42 }
|
Doc 1: {
"?foo" : "bar",
"bar" : 42
}
|
--- ?foo: bar bar: 42 |
{?foo: bar, bar: 42} |
| 65WH - Single Entry Block Sequence | |||||
| Tags: sequence View source |
- foo |
$doc1 = ["foo"] |
Doc 1: [ "foo" ] |
--- - foo |
- foo |
| 6BCT - Spec Example 6.3. Separation Spaces | |||||
| Tags: libyaml-err, sequence, spec, upto-1.2, whitespace View source |
- foo: bar - - baz - baz |
$doc1 = [{ foo => "bar" }, ["baz", "baz"]]
|
Doc 1: [
{
"foo" : "bar"
},
[
"baz",
"baz"
]
]
|
--- - foo: bar - - baz - baz |
- foo: bar - - baz - baz |
| 6BFJ - Mapping, key and flow sequence item anchors | |||||
| Tags: anchor, complex-key, flow, mapping, sequence View source |
--- &mapping &key [ &item a, b, c ]: value Line : 3 Column : 16 Message : A node can only have one anchor Where : YAML/PP/Parser.pm line 704 YAML : " b, c ]: value\n" at YAML/PP/Loader.pm line 94. |
||||
| 6CA3 - Tab indented top flow | |||||
| Tags: indent, whitespace View source |
[ ] |
$doc1 = [] |
Doc 1: [] |
--- [] |
[] |
| 6CK3 - Spec Example 6.26. Tag Shorthands | |||||
| Tags: local-tag, spec, tag View source |
%TAG !e! tag:example.com,2000:app/ --- - !local foo - !!str bar - !e!tag%21 baz |
$doc1 = ["foo", "bar", "baz"] |
Doc 1: [ "foo", "bar", "baz" ] |
--- - foo - bar - baz |
--- - !local foo - !!str bar - !<tag:example.com,2000:app/tag!> baz |
| 6FWR - Block Scalar Keep | |||||
| Tags: literal, scalar, whitespace View source |
--- |+ ab ... |
$doc1 = "ab\n\n \n" |
Doc 1: "ab\n\n \n" |
--- | ab |
--- | ab ... |
| 6H3V - Backslashes in singlequotes | |||||
| Tags: scalar, single View source |
'foo: bar\': baz' |
$doc1 = { "foo: bar\\" => "baz'" }
|
Doc 1: {
"foo: bar\\" : "baz'"
}
|
--- 'foo: bar\': baz' |
'foo: bar\': baz' |
| 6HB6 - Spec Example 6.1. Indentation Spaces | |||||
| Tags: comment, flow, indent, spec, upto-1.2, whitespace View source |
# Leading comment line spaces are # neither content nor indentation. Not indented: By one space: | By four spaces Flow style: [ # Leading spaces By two, # in flow style Also by two, # are neither Still by two # content nor ] # indentation. |
$doc1 = {
"Not indented" => {
"By one space" => "By four\n spaces\n",
"Flow style" => ["By two", "Also by two", "Still by two"],
},
}
|
Doc 1: {
"Not indented" : {
"By one space" : "By four\n spaces\n",
"Flow style" : [
"By two",
"Also by two",
"Still by two"
]
}
}
|
--- Not indented: By one space: | By four spaces Flow style: - By two - Also by two - Still by two |
Not indented: By one space: | By four spaces Flow style: - By two - Also by two - Still by two |
| 6JQW - Spec Example 2.13. In literals, newlines are preserved | |||||
| Tags: comment, literal, scalar, spec View source |
# ASCII Art --- | \//||\/|| // || ||__ |
$doc1 = "\\//||\\/||\n// || ||__\n" |
Doc 1: "\\//||\\/||\n// || ||__\n" |
--- | \//||\/|| // || ||__ |
--- | \//||\/|| // || ||__ |
| 6JWB - Tags for Block Objects | |||||
| Tags: mapping, sequence, tag View source |
foo: !!seq - !!str a - !!map key: !!str value |
$doc1 = { foo => ["a", { key => "value" }] }
|
Doc 1: {
"foo" : [
"a",
{
"key" : "value"
}
]
}
|
--- foo: - a - key: value |
foo: !!seq - !!str a - !!map key: !!str value |
| 6KGN - Anchor for empty node | |||||
| Tags: alias, anchor View source |
--- a: &anchor b: *anchor |
$doc1 = { a => undef, b => undef }
|
Doc 1: {
"a" : null,
"b" : null
}
|
--- a: null b: null |
--- a: &anchor b: *anchor |
| 6LVF - Spec Example 6.13. Reserved Directives | |||||
| Tags: 1.3-err, directive, double, header, spec View source |
%FOO bar baz # Should be ignored # with a warning. --- "foo" |
$doc1 = "foo" |
Doc 1: "foo" |
--- foo |
--- "foo" |
| 6M2F - Aliases in Explicit Block Mapping | |||||
| Tags: alias, empty-key, explicit-key View source |
? &a a : &b b : *a |
$doc1 = { "" => "a", "a" => "b" }
|
Doc 1: {
"" : "a",
"a" : "b"
}
|
--- '': a a: b |
&a a: &b b : *a |
| 6PBE - Zero-indented sequences in explicit mapping keys | |||||
| Tags: explicit-key, mapping, sequence View source |
--- ? - a - b : - c - d |
$doc1 = { "['a','b']" => ["c", "d"] }
|
Doc 1: {
"['a','b']" : [
"c",
"d"
]
}
|
--- "['a','b']": - c - d |
--- ? - a - b : - c - d |
| 6SLA - Allowed characters in quoted mapping key | |||||
| Tags: double, mapping, single View source |
"foo\nbar:baz\tx \\$%^&*()x": 23 'x\ny:z\tx $%^&*()x': 24 |
$doc1 = { "foo\nbar:baz\tx \\\$%^&*()x" => 23, "x\\ny:z\\tx \$%^&*()x" => 24 }
|
Doc 1: {
"foo\nbar:baz\tx \\$%^&*()x" : 23,
"x\\ny:z\\tx $%^&*()x" : 24
}
|
--- "foo\nbar:baz\tx \\$%^&*()x": 23 x\ny:z\tx $%^&*()x: 24 |
"foo\nbar:baz\tx \\$%^&*()x": 23 'x\ny:z\tx $%^&*()x': 24 |
| 6VJK - Spec Example 2.15. Folded newlines are preserved for "more indented" and blank lines | |||||
| Tags: 1.3-err, folded, scalar, spec View source |
> Sammy Sosa completed another fine season with great stats. 63 Home Runs 0.288 Batting Average What a year! |
$doc1 = "Sammy Sosa completed another fine season with great stats.\n\n 63 Home Runs\n 0.288 Batting Average\n\nWhat a year!\n" |
Doc 1: "Sammy Sosa completed another fine season with great stats.\n\n 63 Home Runs\n 0.288 Batting Average\n\nWhat a year!\n" |
--- | Sammy Sosa completed another fine season with great stats. 63 Home Runs 0.288 Batting Average What a year! |
> Sammy Sosa completed another fine season with great stats. 63 Home Runs 0.288 Batting Average What a year! |
| 6WLZ - Spec Example 6.18. Primary Tag Handle [1.3] | |||||
| Tags: 1.3-mod, directive, local-tag, spec, tag View source |
# Private --- !foo "bar" ... # Global %TAG ! tag:example.com,2000:app/ --- !foo "bar" |
$doc1 = "bar" $doc2 = "bar" |
Doc 1: "bar" Doc 2: "bar" |
--- bar --- bar |
--- !foo "bar" ... --- !<tag:example.com,2000:app/foo> "bar" |
| 6WPF - Spec Example 6.8. Flow Folding [1.3] | |||||
| Tags: 1.3-mod, double, scalar, spec, whitespace View source |
--- " foo bar baz " |
$doc1 = " foo\nbar\nbaz " |
Doc 1: " foo\nbar\nbaz " |
--- |2- foo bar baz |
--- " foo\nbar\nbaz " |
| 6XDY - Two document start markers | |||||
| Tags: header View source |
--- --- |
$doc1 = undef $doc2 = undef |
Doc 1: null Doc 2: null |
--- null --- null |
--- --- |
| 6ZKB - Spec Example 9.6. Stream | |||||
| Tags: 1.3-err, header, spec View source |
Document --- # Empty ... %YAML 1.2 --- matches %: 20 |
$doc1 = "Document"
$doc2 = undef
$doc3 = { "matches %" => 20 }
|
Doc 1: "Document"
Doc 2: null
Doc 3: {
"matches %" : 20
}
|
--- Document --- null --- matches %: 20 |
Document --- ... %YAML 1.2 --- matches %: 20 |
| 735Y - Spec Example 8.20. Block Node Types | |||||
| Tags: comment, double, folded, spec, tag View source |
- "flow in block" - > Block scalar - !!map # Block collection foo : bar |
$doc1 = ["flow in block", "Block scalar\n", { foo => "bar" }]
|
Doc 1: [
"flow in block",
"Block scalar\n",
{
"foo" : "bar"
}
]
|
--- - flow in block - | Block scalar - foo: bar |
- "flow in block" - > Block scalar - !!map foo: bar |
| 74H7 - Tags in Implicit Mapping | |||||
| Tags: mapping, tag View source |
!!str a: b c: !!int 42 e: !!str f g: h !!str 23: !!bool false |
$doc1 = {
23 => bless(do{\(my $o = 0)}, "JSON::PP::Boolean"),
a => "b",
c => 42,
e => "f",
g => "h",
}
|
Doc 1: {
"23" : false,
"a" : "b",
"c" : 42,
"e" : "f",
"g" : "h"
}
|
--- '23': false a: b c: 42 e: f g: h |
!!str a: b c: !!int 42 e: !!str f g: h !!str 23: !!bool false |
| 753E - Block Scalar Strip [1.3] | |||||
| Tags: 1.3-mod, literal, scalar, whitespace View source |
--- |- ab ... |
$doc1 = "ab" |
Doc 1: "ab" |
--- ab |
--- |- ab ... |
| 7A4E - Spec Example 7.6. Double Quoted Lines | |||||
| Tags: scalar, spec, upto-1.2, whitespace View source |
" 1st non-empty 2nd non-empty 3rd non-empty " |
$doc1 = " 1st non-empty\n2nd non-empty 3rd non-empty " |
Doc 1: " 1st non-empty\n2nd non-empty 3rd non-empty " |
--- |2- 1st non-empty 2nd non-empty 3rd non-empty |
" 1st non-empty\n2nd non-empty 3rd non-empty " |
| 7BMT - Node and Mapping Key Anchors [1.3] | |||||
| Tags: 1.3-mod, anchor, comment, mapping View source |
--- top1: &node1 &k1 key1: one top2: &node2 # comment key2: two top3: &k3 key3: three top4: &node4 &k4 key4: four top5: &node5 key5: five top6: &val6 six top7: &val7 seven |
$doc1 = {
top1 => { key1 => "one" },
top2 => { key2 => "two" },
top3 => { key3 => "three" },
top4 => { key4 => "four" },
top5 => { key5 => "five" },
top6 => "six",
top7 => "seven",
}
|
Doc 1: {
"top1" : {
"key1" : "one"
},
"top2" : {
"key2" : "two"
},
"top3" : {
"key3" : "three"
},
"top4" : {
"key4" : "four"
},
"top5" : {
"key5" : "five"
},
"top6" : "six",
"top7" : "seven"
}
|
--- top1: key1: one top2: key2: two top3: key3: three top4: key4: four top5: key5: five top6: six top7: seven |
--- top1: &node1 &k1 key1: one top2: &node2 key2: two top3: &k3 key3: three top4: &node4 &k4 key4: four top5: &node5 key5: five top6: &val6 six top7: &val7 seven |
| 7BUB - Spec Example 2.10. Node for “Sammy Sosa” appears twice in this document | |||||
| Tags: alias, mapping, sequence, spec View source |
--- hr: - Mark McGwire # Following node labeled SS - &SS Sammy Sosa rbi: - *SS # Subsequent occurrence - Ken Griffey |
$doc1 = {
hr => ["Mark McGwire", "Sammy Sosa"],
rbi => ["Sammy Sosa", "Ken Griffey"],
}
|
Doc 1: {
"hr" : [
"Mark McGwire",
"Sammy Sosa"
],
"rbi" : [
"Sammy Sosa",
"Ken Griffey"
]
}
|
--- hr: - Mark McGwire - Sammy Sosa rbi: - Sammy Sosa - Ken Griffey |
--- hr: - Mark McGwire - &SS Sammy Sosa rbi: - *SS - Ken Griffey |
| 7FWL - Spec Example 6.24. Verbatim Tags | |||||
| Tags: mapping, spec, tag, unknown-tag View source |
!<tag:yaml.org,2002:str> foo : !<!bar> baz |
$doc1 = { foo => "baz" }
|
Doc 1: {
"foo" : "baz"
}
|
--- foo: baz |
!!str foo: !bar baz |
| 7T8X - Spec Example 8.10. Folded Lines - 8.13. Final Empty Lines | |||||
| Tags: 1.3-err, comment, folded, scalar, spec View source |
> folded line next line * bullet * list * lines last line # Comment |
$doc1 = "\nfolded line\nnext line\n * bullet\n\n * list\n * lines\n\nlast line\n" |
Doc 1: "\nfolded line\nnext line\n * bullet\n\n * list\n * lines\n\nlast line\n" |
--- | folded line next line * bullet * list * lines last line |
> folded line next line * bullet * list * lines last line |
| 7TMG - Comment in flow sequence before comma | |||||
| Tags: comment, flow, sequence View source |
--- [ word1 # comment , word2] |
$doc1 = ["word1", "word2"] |
Doc 1: [ "word1", "word2" ] |
--- - word1 - word2 |
--- - word1 - word2 |
| 7W2P - Block Mapping with Missing Values | |||||
| Tags: explicit-key, mapping View source |
? a ? b c: |
$doc1 = { a => undef, b => undef, c => undef }
|
Doc 1: {
"a" : null,
"b" : null,
"c" : null
}
|
--- a: null b: null c: null |
a: b: c: |
| 7Z25 - Bare document after document end marker | |||||
| Tags: footer View source |
--- scalar1 ... key: value |
$doc1 = "scalar1"
$doc2 = { key => "value" }
|
Doc 1: "scalar1"
Doc 2: {
"key" : "value"
}
|
--- scalar1 --- key: value |
--- scalar1 ... key: value |
| 7ZZ5 - Empty flow collections | |||||
| Tags: flow, mapping, sequence View source |
--- nested sequences: - - - [] - - - {} key1: [] key2: {} |
$doc1 = { "key1" => [], "key2" => {}, "nested sequences" => [[[[]]], [[{}]]] }
|
Doc 1: {
"key1" : [],
"key2" : {},
"nested sequences" : [
[
[
[]
]
],
[
[
{}
]
]
]
}
|
--- key1: [] key2: {} nested sequences: - - - [] - - - {} |
--- nested sequences: - - - [] - - - {} key1: [] key2: {} |
| 82AN - Three dashes and content without space | |||||
| Tags: 1.3-err, scalar View source |
---word1 word2 |
$doc1 = "---word1 word2" |
Doc 1: "---word1 word2" |
--- '---word1 word2' |
'---word1 word2' |
| 87E4 - Spec Example 7.8. Single Quoted Implicit Keys | |||||
| Tags: flow, mapping, sequence, spec View source |
'implicit block key' : [ 'implicit flow key' : value, ] |
$doc1 = { "implicit block key" => [{ "implicit flow key" => "value" }] }
|
Doc 1: {
"implicit block key" : [
{
"implicit flow key" : "value"
}
]
}
|
--- implicit block key: - implicit flow key: value |
'implicit block key': - {'implicit flow key': value} |
| 8CWC - Plain mapping key ending with colon | |||||
| Tags: mapping, scalar View source |
--- key ends with two colons::: value Line : 2 Column : 25 Message : Invalid plain scalar Where : YAML/PP/Lexer.pm line 378 YAML : "::: value" at YAML/PP/Loader.pm line 94. |
||||
| 8G76 - Spec Example 6.10. Comment Lines | |||||
| Tags: comment, empty, scalar, spec, whitespace View source |
# Comment |
||||
| 8KB6 - Multiline plain flow mapping key without value | |||||
| Tags: flow, mapping View source |
--- - { single line, a: b} - { multi line, a: b} |
$doc1 = [
{ "a" => "b", "single line" => undef },
{ "a" => "b", "multi line" => undef },
]
|
Doc 1: [
{
"a" : "b",
"single line" : null
},
{
"a" : "b",
"multi line" : null
}
]
|
--- - a: b single line: null - a: b multi line: null |
--- - {single line: , a: b} - {multi line: , a: b} |
| 8MK2 - Explicit Non-Specific Tag | |||||
| Tags: 1.3-err, tag View source |
! a |
$doc1 = "a" |
Doc 1: "a" |
--- a |
! a |
| 8QBE - Block Sequence in Block Mapping | |||||
| Tags: mapping, sequence View source |
key: - item1 - item2 |
$doc1 = { key => ["item1", "item2"] }
|
Doc 1: {
"key" : [
"item1",
"item2"
]
}
|
--- key: - item1 - item2 |
key: - item1 - item2 |
| 8UDB - Spec Example 7.14. Flow Sequence Entries | |||||
| Tags: flow, sequence, spec View source |
[ "double quoted", 'single quoted', plain text, [ nested ], single: pair, ] |
$doc1 = [
"double quoted",
"single quoted",
"plain text",
["nested"],
{ single => "pair" },
]
|
Doc 1: [
"double quoted",
"single quoted",
"plain text",
[
"nested"
],
{
"single" : "pair"
}
]
|
--- - double quoted - single quoted - plain text - - nested - single: pair |
- "double quoted" - 'single quoted' - plain text - - nested - {single: pair} |
| 8XYN - Anchor with unicode character | |||||
| Tags: anchor View source |
--- - &😁 unicode anchor |
$doc1 = ["unicode anchor"] |
Doc 1: [ "unicode anchor" ] |
--- - unicode anchor |
--- - &😁 unicode anchor |
| 93JH - Block Mappings in Block Sequence | |||||
| Tags: mapping, sequence View source |
- key: value key2: value2 - key3: value3 |
$doc1 = [{ key => "value", key2 => "value2" }, { key3 => "value3" }]
|
Doc 1: [
{
"key" : "value",
"key2" : "value2"
},
{
"key3" : "value3"
}
]
|
--- - key: value key2: value2 - key3: value3 |
- key: value key2: value2 - key3: value3 |
| 93WF - Spec Example 6.6. Line Folding [1.3] | |||||
| Tags: 1.3-mod, folded, scalar, spec, whitespace View source |
--- >- trimmed as space |
$doc1 = "trimmed\n\n\nas space" |
Doc 1: "trimmed\n\n\nas space" |
--- |- trimmed as space |
--- >- trimmed as space |
| 96L6 - Spec Example 2.14. In the folded scalars, newlines become spaces | |||||
| Tags: folded, scalar, spec View source |
--- > Mark McGwire's year was crippled by a knee injury. |
$doc1 = "Mark McGwire's year was crippled by a knee injury.\n" |
Doc 1: "Mark McGwire's year was crippled by a knee injury.\n" |
--- | Mark McGwire's year was crippled by a knee injury. |
--- > Mark McGwire's year was crippled by a knee injury. |
| 96NN/00 - Leading tab content in literals | |||||
| Tags: View source |
foo: |- bar |
$doc1 = { foo => "\tbar" }
|
Doc 1: {
"foo" : "\tbar"
}
|
--- foo: "\tbar" |
foo: |- bar |
| 96NN/01 - Leading tab content in literals | |||||
| Tags: View source |
foo: |- bar |
$doc1 = { foo => "\tbar" }
|
Doc 1: {
"foo" : "\tbar"
}
|
--- foo: "\tbar" |
foo: |- bar |
| 98YD - Spec Example 5.5. Comment Indicator | |||||
| Tags: comment, empty, spec View source |
# Comment only.
|
||||
| 9BXH - Multiline doublequoted flow mapping key without value | |||||
| Tags: double, flow, mapping View source |
--- - { "single line", a: b} - { "multi line", a: b} |
$doc1 = [
{ "a" => "b", "single line" => undef },
{ "a" => "b", "multi line" => undef },
]
|
Doc 1: [
{
"a" : "b",
"single line" : null
},
{
"a" : "b",
"multi line" : null
}
]
|
--- - a: b single line: null - a: b multi line: null |
--- - {"single line": , a: b} - {"multi line": , a: b} |
| 9DXL - Spec Example 9.6. Stream [1.3] | |||||
| Tags: 1.3-mod, header, spec View source |
Mapping: Document --- # Empty ... %YAML 1.2 --- matches %: 20 |
$doc1 = { Mapping => "Document" }
$doc2 = undef
$doc3 = { "matches %" => 20 }
|
Doc 1: {
"Mapping" : "Document"
}
Doc 2: null
Doc 3: {
"matches %" : 20
}
|
--- Mapping: Document --- null --- matches %: 20 |
Mapping: Document --- ... %YAML 1.2 --- matches %: 20 |
| 9FMG - Multi-level Mapping Indent | |||||
| Tags: indent, mapping View source |
a: b: c: d e: f: g h: i |
$doc1 = { a => { b => { c => "d" }, e => { f => "g" } }, h => "i" }
|
Doc 1: {
"a" : {
"b" : {
"c" : "d"
},
"e" : {
"f" : "g"
}
},
"h" : "i"
}
|
--- a: b: c: d e: f: g h: i |
a: b: c: d e: f: g h: i |
| 9J7A - Simple Mapping Indent | |||||
| Tags: indent, mapping, simple View source |
foo: bar: baz |
$doc1 = { foo => { bar => "baz" } }
|
Doc 1: {
"foo" : {
"bar" : "baz"
}
}
|
--- foo: bar: baz |
foo: bar: baz |
| 9KAX - Various combinations of tags and anchors | |||||
| Tags: 1.3-err, anchor, mapping, tag View source |
--- &a1 !!str scalar1 --- !!str &a2 scalar2 --- &a3 !!str scalar3 --- &a4 !!map &a5 !!str key5: value4 --- a6: 1 &anchor6 b6: 2 --- !!map &a8 !!str key8: value7 --- !!map !!str &a10 key10: value9 --- !!str &a11 value11 |
$doc1 = "scalar1"
$doc2 = "scalar2"
$doc3 = "scalar3"
$doc4 = { key5 => "value4" }
$doc5 = { a6 => 1, b6 => 2 }
$doc6 = { key8 => "value7" }
$doc7 = { key10 => "value9" }
$doc8 = "value11"
|
Doc 1: "scalar1"
Doc 2: "scalar2"
Doc 3: "scalar3"
Doc 4: {
"key5" : "value4"
}
Doc 5: {
"a6" : 1,
"b6" : 2
}
Doc 6: {
"key8" : "value7"
}
Doc 7: {
"key10" : "value9"
}
Doc 8: "value11"
|
--- scalar1 --- scalar2 --- scalar3 --- key5: value4 --- a6: 1 b6: 2 --- key8: value7 --- key10: value9 --- value11 |
--- &a1 !!str scalar1 --- &a2 !!str scalar2 --- &a3 !!str scalar3 --- &a4 !!map &a5 !!str key5: value4 --- a6: 1 &anchor6 b6: 2 --- !!map &a8 !!str key8: value7 --- !!map &a10 !!str key10: value9 --- &a11 !!str value11 |
| 9MMW - Single Pair Implicit Entries | |||||
| Tags: flow, mapping, sequence View source |
- [ YAML : separate ] - [ "JSON like":adjacent ] - [ {JSON: like}:adjacent ] Line : 3 Column : 17 Expected : EOL FLOWSEQ_END FLOW_COMMA WS Got : PLAIN Where : YAML/PP/Parser.pm line 392 YAML : ":adjacent ]" at YAML/PP/Loader.pm line 94. |
||||
| 9MQT/00 - Scalar doc with '...' in content | |||||
| Tags: View source |
--- "a ...x b" |
$doc1 = "a ...x b" |
Doc 1: "a ...x b" |
--- a ...x b |
--- "a ...x b" |
| 9SA2 - Multiline double quoted flow mapping key | |||||
| Tags: double, flow, mapping View source |
--- - { "single line": value} - { "multi line": value} |
$doc1 = [{ "single line" => "value" }, { "multi line" => "value" }]
|
Doc 1: [
{
"single line" : "value"
},
{
"multi line" : "value"
}
]
|
--- - single line: value - multi line: value |
--- - {"single line": value} - {"multi line": value} |
| 9SHH - Spec Example 5.8. Quoted Scalar Indicators | |||||
| Tags: scalar, spec View source |
single: 'text' double: "text" |
$doc1 = { double => "text", single => "text" }
|
Doc 1: {
"double" : "text",
"single" : "text"
}
|
--- double: text single: text |
single: 'text' double: "text" |
| 9TFX - Spec Example 7.6. Double Quoted Lines [1.3] | |||||
| Tags: 1.3-mod, double, scalar, spec, whitespace View source |
--- " 1st non-empty 2nd non-empty 3rd non-empty " |
$doc1 = " 1st non-empty\n2nd non-empty 3rd non-empty " |
Doc 1: " 1st non-empty\n2nd non-empty 3rd non-empty " |
--- |2- 1st non-empty 2nd non-empty 3rd non-empty |
--- " 1st non-empty\n2nd non-empty 3rd non-empty " |
| 9U5K - Spec Example 2.12. Compact Nested Mapping | |||||
| Tags: mapping, sequence, spec View source |
--- # Products purchased - item : Super Hoop quantity: 1 - item : Basketball quantity: 4 - item : Big Shoes quantity: 1 |
$doc1 = [
{ item => "Super Hoop", quantity => 1 },
{ item => "Basketball", quantity => 4 },
{ item => "Big Shoes", quantity => 1 },
]
|
Doc 1: [
{
"item" : "Super Hoop",
"quantity" : 1
},
{
"item" : "Basketball",
"quantity" : 4
},
{
"item" : "Big Shoes",
"quantity" : 1
}
]
|
--- - item: Super Hoop quantity: 1 - item: Basketball quantity: 4 - item: Big Shoes quantity: 1 |
--- - item: Super Hoop quantity: 1 - item: Basketball quantity: 4 - item: Big Shoes quantity: 1 |
| 9WXW - Spec Example 6.18. Primary Tag Handle | |||||
| Tags: 1.3-err, directive, local-tag, spec, tag, unknown-tag View source |
# Private !foo "bar" ... # Global %TAG ! tag:example.com,2000:app/ --- !foo "bar" |
$doc1 = "bar" $doc2 = "bar" |
Doc 1: "bar" Doc 2: "bar" |
--- bar --- bar |
!foo "bar" ... --- !<tag:example.com,2000:app/foo> "bar" |
| 9YRD - Multiline Scalar at Top Level | |||||
| Tags: 1.3-err, scalar, whitespace View source |
a b c d e |
$doc1 = "a b c d\ne" |
Doc 1: "a b c d\ne" |
--- |- a b c d e |
|- a b c d e |
| A2M4 - Spec Example 6.2. Indentation Indicators | |||||
| Tags: explicit-key, indent, libyaml-err, sequence, spec, upto-1.2, whitespace View source |
? a : - b - - c - d |
$doc1 = { a => ["b", ["c", "d"]] }
|
Doc 1: {
"a" : [
"b",
[
"c",
"d"
]
]
}
|
--- a: - b - - c - d |
a: - b - - c - d |
| A6F9 - Spec Example 8.4. Chomping Final Line Break | |||||
| Tags: literal, scalar, spec View source |
strip: |- text clip: | text keep: |+ text |
$doc1 = { clip => "text\n", keep => "text\n", strip => "text" }
|
Doc 1: {
"clip" : "text\n",
"keep" : "text\n",
"strip" : "text"
}
|
--- clip: | text keep: | text strip: text |
strip: |- text clip: | text keep: | text |
| A984 - Multiline Scalar in Mapping | |||||
| Tags: scalar View source |
a: b c d: e f |
$doc1 = { a => "b c", d => "e f" }
|
Doc 1: {
"a" : "b c",
"d" : "e f"
}
|
--- a: b c d: e f |
a: b c d: e f |
| AB8U - Sequence entry that looks like two with wrong indentation | |||||
| Tags: scalar, sequence View source |
- single multiline - sequence entry |
$doc1 = ["single multiline - sequence entry"] |
Doc 1: [ "single multiline - sequence entry" ] |
--- - single multiline - sequence entry |
- single multiline - sequence entry |
| AVM7 - Empty Stream | |||||
| Tags: edge View source |
|||||
| AZ63 - Sequence With Same Indentation as Parent Mapping | |||||
| Tags: indent, mapping, sequence View source |
one: - 2 - 3 four: 5 |
$doc1 = { four => 5, one => [2, 3] }
|
Doc 1: {
"four" : 5,
"one" : [
2,
3
]
}
|
--- four: 5 one: - 2 - 3 |
one: - 2 - 3 four: 5 |
| AZW3 - Lookahead test cases | |||||
| Tags: edge, mapping View source |
- bla"keks: foo - bla]keks: foo |
$doc1 = [{ "bla\"keks" => "foo" }, { "bla]keks" => "foo" }]
|
Doc 1: [
{
"bla\"keks" : "foo"
},
{
"bla]keks" : "foo"
}
]
|
--- - bla"keks: foo - bla]keks: foo |
- bla"keks: foo - bla]keks: foo |
| B3HG - Spec Example 8.9. Folded Scalar [1.3] | |||||
| Tags: 1.3-mod, folded, scalar, spec View source |
--- > folded text |
$doc1 = "folded text\n" |
Doc 1: "folded text\n" |
--- | folded text |
--- > folded text |
| BEC7 - Spec Example 6.14. “YAML” directive | |||||
| Tags: directive, spec View source |
%YAML 1.3 # Attempt parsing # with a warning --- "foo" |
$doc1 = "foo" |
Doc 1: "foo" |
--- foo |
%YAML 1.2 --- "foo" |
| BU8L - Node Anchor and Tag on Seperate Lines | |||||
| Tags: 1.3-err, anchor, indent, tag View source |
key: &anchor !!map a: b |
$doc1 = { key => { a => "b" } }
|
Doc 1: {
"key" : {
"a" : "b"
}
}
|
--- key: a: b |
key: &anchor !!map a: b |
| C2DT - Spec Example 7.18. Flow Mapping Adjacent Values | |||||
| Tags: flow, mapping, spec View source |
{ "adjacent":value, "readable": value, "empty": } |
$doc1 = { adjacent => "value", empty => undef, readable => "value" }
|
Doc 1: {
"adjacent" : "value",
"empty" : null,
"readable" : "value"
}
|
--- adjacent: value empty: null readable: value |
{"adjacent": value, "readable": value, "empty": } |
| C4HZ - Spec Example 2.24. Global Tags | |||||
| Tags: alias, directive, local-tag, spec, tag View source |
%TAG ! tag:clarkevans.com,2002: --- !shape # Use the ! handle for presenting # tag:clarkevans.com,2002:circle - !circle center: &ORIGIN {x: 73, y: 129} radius: 7 - !line start: *ORIGIN finish: { x: 89, y: 102 } - !label start: *ORIGIN color: 0xFFEEBB text: Pretty vector drawing. |
$doc1 = do {
my $a = [
{ center => { x => 73, y => 129 }, radius => 7 },
{ finish => { x => 89, y => 102 }, start => 'fix' },
{ color => 16772795, start => 'fix', text => "Pretty vector drawing." },
];
$a->[1]{start} = $a->[0]{center};
$a->[2]{start} = $a->[0]{center};
$a;
}
|
Doc 1: [
{
"center" : {
"x" : 73,
"y" : 129
},
"radius" : 7
},
{
"finish" : {
"x" : 89,
"y" : 102
},
"start" : {
"x" : 73,
"y" : 129
}
},
{
"color" : 16772795,
"start" : {
"x" : 73,
"y" : 129
},
"text" : "Pretty vector drawing."
}
]
|
--- - center: &1 x: 73 y: 129 radius: 7 - finish: x: 89 y: 102 start: *1 - color: 16772795 start: *1 text: Pretty vector drawing. |
--- !<tag:clarkevans.com,2002:shape> - !<tag:clarkevans.com,2002:circle> center: &ORIGIN {x: 73, y: 129} radius: 7 - !<tag:clarkevans.com,2002:line> start: *ORIGIN finish: {x: 89, y: 102} - !<tag:clarkevans.com,2002:label> start: *ORIGIN color: 0xFFEEBB text: Pretty vector drawing. |
| CC74 - Spec Example 6.20. Tag Handles | |||||
| Tags: directive, spec, tag, unknown-tag View source |
%TAG !e! tag:example.com,2000:app/ --- !e!foo "bar" |
$doc1 = "bar" |
Doc 1: "bar" |
--- bar |
--- !<tag:example.com,2000:app/foo> "bar" |
| CFD4 - Empty implicit key in single pair flow sequences | |||||
| Tags: empty-key, flow, sequence View source |
- [ : empty key ] - [: another empty key] |
$doc1 = [[{ "" => "empty key" }], [{ "" => "another empty key" }]]
|
Doc 1: [
[
{
"" : "empty key"
}
],
[
{
"" : "another empty key"
}
]
]
|
--- - - '': empty key - - '': another empty key |
- - {: empty key} - - {: another empty key} |
| CN3R - Various location of anchors in flow sequence | |||||
| Tags: anchor, flow, mapping, sequence View source |
&flowseq [ a: b, &c c: d, { &e e: f }, &g { g: h } ] |
$doc1 = [{ a => "b" }, { c => "d" }, { e => "f" }, { g => "h" }]
|
Doc 1: [
{
"a" : "b"
},
{
"c" : "d"
},
{
"e" : "f"
},
{
"g" : "h"
}
]
|
--- - a: b - c: d - e: f - g: h |
&flowseq - {a: b} - {&c c: d} - {&e e: f} - &g {g: h} |
| CPZ3 - Doublequoted scalar starting with a tab | |||||
| Tags: double, scalar View source |
--- tab: "\tstring" |
$doc1 = { tab => "\tstring" }
|
Doc 1: {
"tab" : "\tstring"
}
|
--- tab: "\tstring" |
--- tab: "\tstring" |
| CT4Q - Spec Example 7.20. Single Pair Explicit Entry | |||||
| Tags: explicit-key, flow, mapping, spec View source |
[ ? foo bar : baz ] Line : 2 Column : 1 Expected : ALIAS COLON FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUOTED QUOTED_MULTILINE Got : QUESTION Where : YAML/PP/Parser.pm line 392 YAML : "? foo\n" at YAML/PP/Loader.pm line 94. |
||||
| CUP7 - Spec Example 5.6. Node Property Indicators | |||||
| Tags: alias, local-tag, spec, tag View source |
anchored: !local &anchor value alias: *anchor |
$doc1 = { alias => "value", anchored => "value" }
|
Doc 1: {
"alias" : "value",
"anchored" : "value"
}
|
--- alias: value anchored: value |
anchored: &anchor !local value alias: *anchor |
| D83L - Block scalar indicator order | |||||
| Tags: indent, literal View source |
- |2- explicit indent and chomp - |-2 chomp and explicit indent |
$doc1 = ["explicit indent and chomp", "chomp and explicit indent"] |
Doc 1: [ "explicit indent and chomp", "chomp and explicit indent" ] |
--- - explicit indent and chomp - chomp and explicit indent |
- |- explicit indent and chomp - |- chomp and explicit indent |
| D88J - Flow Sequence in Block Mapping | |||||
| Tags: flow, mapping, sequence View source |
a: [b, c] |
$doc1 = { a => ["b", "c"] }
|
Doc 1: {
"a" : [
"b",
"c"
]
}
|
--- a: - b - c |
a: - b - c |
| D9TU - Single Pair Block Mapping | |||||
| Tags: mapping, simple View source |
foo: bar |
$doc1 = { foo => "bar" }
|
Doc 1: {
"foo" : "bar"
}
|
--- foo: bar |
foo: bar |
| DBG4 - Spec Example 7.10. Plain Characters | |||||
| Tags: flow, scalar, sequence, spec View source |
# Outside flow collection: - ::vector - ": - ()" - Up, up, and away! - -123 - http://example.com/foo#bar # Inside flow collection: - [ ::vector, ": - ()", "Up, up and away!", -123, http://example.com/foo#bar ] |
$doc1 = [
"::vector",
": - ()",
"Up, up, and away!",
-123,
"http://example.com/foo#bar",
[
"::vector",
": - ()",
"Up, up and away!",
-123,
"http://example.com/foo#bar",
],
]
|
Doc 1: [
"::vector",
": - ()",
"Up, up, and away!",
-123,
"http://example.com/foo#bar",
[
"::vector",
": - ()",
"Up, up and away!",
-123,
"http://example.com/foo#bar"
]
]
|
--- - ::vector - ': - ()' - Up, up, and away! - -123 - http://example.com/foo#bar - - ::vector - ': - ()' - Up, up and away! - -123 - http://example.com/foo#bar |
- ::vector - ": - ()" - Up, up, and away! - -123 - http://example.com/foo#bar - - ::vector - ": - ()" - "Up, up and away!" - -123 - http://example.com/foo#bar |
| DC7X - Various trailing tabs | |||||
| Tags: comment, whitespace View source |
a: b seq: - a c: d #X |
$doc1 = { a => "b", c => "d", seq => ["a"] }
|
Doc 1: {
"a" : "b",
"c" : "d",
"seq" : [
"a"
]
}
|
--- a: b c: d seq: - a |
a: b seq: - a c: d |
| DE56/00 - Trailing tabs in double quoted | |||||
| Tags: View source |
"1 trailing\t tab" |
$doc1 = "1 trailing\t tab" |
Doc 1: "1 trailing\t tab" |
--- "1 trailing\t tab" |
"1 trailing\t tab" |
| DE56/01 - Trailing tabs in double quoted | |||||
| Tags: View source |
"2 trailing\t tab" |
$doc1 = "2 trailing\t tab" |
Doc 1: "2 trailing\t tab" |
--- "2 trailing\t tab" |
"2 trailing\t tab" |
| DE56/02 - Trailing tabs in double quoted | |||||
| Tags: View source |
"3 trailing\ tab" |
$doc1 = "3 trailing\t tab" |
Doc 1: "3 trailing\t tab" |
--- "3 trailing\t tab" |
"3 trailing\t tab" |
| DE56/03 - Trailing tabs in double quoted | |||||
| Tags: View source |
"4 trailing\ tab" |
$doc1 = "4 trailing\t tab" |
Doc 1: "4 trailing\t tab" |
--- "4 trailing\t tab" |
"4 trailing\t tab" |
| DE56/04 - Trailing tabs in double quoted | |||||
| Tags: View source |
"5 trailing tab" |
$doc1 = "5 trailing tab" |
Doc 1: "5 trailing tab" |
--- 5 trailing tab |
"5 trailing tab" |
| DE56/05 - Trailing tabs in double quoted | |||||
| Tags: View source |
"6 trailing tab" |
$doc1 = "6 trailing tab" |
Doc 1: "6 trailing tab" |
--- 6 trailing tab |
"6 trailing tab" |
| DFF7 - Spec Example 7.16. Flow Mapping Entries | |||||
| Tags: explicit-key, flow, mapping, spec View source |
{ ? explicit: entry, implicit: entry, ? } |
$doc1 = { "" => undef, "explicit" => "entry", "implicit" => "entry" }
|
Doc 1: {
"" : null,
"explicit" : "entry",
"implicit" : "entry"
}
|
--- '': null explicit: entry implicit: entry |
{explicit: entry, implicit: entry, : } |
| DHP8 - Flow Sequence | |||||
| Tags: flow, sequence View source |
[foo, bar, 42] |
$doc1 = ["foo", "bar", 42] |
Doc 1: [ "foo", "bar", 42 ] |
--- - foo - bar - 42 |
- foo - bar - 42 |
| DK3J - Zero indented block scalar with line that looks like a comment | |||||
| Tags: comment, folded, scalar View source |
--- > line1 # no comment line3 |
$doc1 = "line1 # no comment line3\n" |
Doc 1: "line1 # no comment line3\n" |
--- | line1 # no comment line3 |
--- > line1 # no comment line3 |
| DK95/00 - Tabs that look like indentation | |||||
| Tags: View source |
foo: bar |
$doc1 = { foo => "bar" }
|
Doc 1: {
"foo" : "bar"
}
|
--- foo: bar |
foo: bar |
| DK95/02 - Tabs that look like indentation | |||||
| Tags: View source |
foo: "bar baz" |
$doc1 = { foo => "bar baz" }
|
Doc 1: {
"foo" : "bar baz"
}
|
--- foo: bar baz |
foo: "bar baz" |
| DK95/03 - Tabs that look like indentation | |||||
| Tags: View source |
foo: 1 |
$doc1 = { foo => 1 }
|
Doc 1: {
"foo" : 1
}
|
--- foo: 1 |
foo: 1 |
| DK95/04 - Tabs that look like indentation | |||||
| Tags: View source |
foo: 1 bar: 2 |
$doc1 = { bar => 2, foo => 1 }
|
Doc 1: {
"bar" : 2,
"foo" : 1
}
|
--- bar: 2 foo: 1 |
foo: 1 bar: 2 |
| DK95/05 - Tabs that look like indentation | |||||
| Tags: View source |
foo: 1 bar: 2 |
$doc1 = { bar => 2, foo => 1 }
|
Doc 1: {
"bar" : 2,
"foo" : 1
}
|
--- bar: 2 foo: 1 |
foo: 1 bar: 2 |
| DK95/07 - Tabs that look like indentation | |||||
| Tags: View source |
%YAML 1.2 --- |
$doc1 = undef |
Doc 1: null |
--- null |
%YAML 1.2 --- |
| DK95/08 - Tabs that look like indentation | |||||
| Tags: View source |
foo: "bar baz " |
$doc1 = { foo => "bar baz \t \t " }
|
Doc 1: {
"foo" : "bar baz \t \t "
}
|
--- foo: "bar baz \t \t " |
foo: "bar baz \t \t " |
| DWX9 - Spec Example 8.8. Literal Content | |||||
| Tags: 1.3-err, comment, literal, scalar, spec, whitespace View source |
| literal text # Comment |
$doc1 = "\n\nliteral\n \n\ntext\n" |
Doc 1: "\n\nliteral\n \n\ntext\n" |
--- | literal text |
| literal text |
| E76Z - Aliases in Implicit Block Mapping | |||||
| Tags: alias, mapping View source |
&a a: &b b *b : *a |
$doc1 = { a => "b", b => "a" }
|
Doc 1: {
"a" : "b",
"b" : "a"
}
|
--- a: b b: a |
&a a: &b b *b : *a |
| EHF6 - Tags for Flow Objects | |||||
| Tags: flow, mapping, sequence, tag View source |
!!map { k: !!seq [ a, !!str b] } |
$doc1 = { k => ["a", "b"] }
|
Doc 1: {
"k" : [
"a",
"b"
]
}
|
--- k: - a - b |
!!map {k: !!seq [a, !!str b]} |
| EX5H - Multiline Scalar at Top Level [1.3] | |||||
| Tags: 1.3-mod, scalar, whitespace View source |
--- a b c d e |
$doc1 = "a b c d\ne" |
Doc 1: "a b c d\ne" |
--- |- a b c d e |
--- |- a b c d e |
| EXG3 - Three dashes and content without space [1.3] | |||||
| Tags: 1.3-mod, scalar View source |
--- ---word1 word2 |
$doc1 = "---word1 word2" |
Doc 1: "---word1 word2" |
--- '---word1 word2' |
--- '---word1 word2' |
| F2C7 - Anchors and Tags | |||||
| Tags: anchor, tag View source |
- &a !!str a - !!int 2 - !!int &c 4 - &d d |
$doc1 = ["a", 2, 4, "d"] |
Doc 1: [ "a", 2, 4, "d" ] |
--- - a - 2 - 4 - d |
- &a !!str a - !!int 2 - &c !!int 4 - &d d |
| F3CP - Nested flow collections on one line | |||||
| Tags: flow, mapping, sequence View source |
--- { a: [b, c, { d: [e, f] } ] } |
$doc1 = { a => ["b", "c", { d => ["e", "f"] }] }
|
Doc 1: {
"a" : [
"b",
"c",
{
"d" : [
"e",
"f"
]
}
]
}
|
--- a: - b - c - d: - e - f |
--- {a: [b, c, {d: [e, f]}]} |
| F6MC - More indented lines at the beginning of folded block scalars | |||||
| Tags: folded, indent View source |
--- a: >2 more indented regular b: >2 more indented regular |
$doc1 = {
a => " more indented\nregular\n",
b => "\n\n more indented\nregular\n",
}
|
Doc 1: {
"a" : " more indented\nregular\n",
"b" : "\n\n more indented\nregular\n"
}
|
--- a: |2 more indented regular b: |2 more indented regular |
--- a: >2 more indented regular b: >2 more indented regular |
| F8F9 - Spec Example 8.5. Chomping Trailing Lines | |||||
| Tags: comment, literal, scalar, spec View source |
# Strip # Comments: strip: |- # text # Clip # comments: clip: | # text # Keep # comments: keep: |+ # text # Trail # comments. |
$doc1 = { clip => "# text\n", keep => "# text\n\n", strip => "# text" }
|
Doc 1: {
"clip" : "# text\n",
"keep" : "# text\n\n",
"strip" : "# text"
}
|
--- clip: | # text keep: |+ # text strip: '# text' |
strip: |- # text clip: | # text keep: |+ # text ... |
| FBC9 - Allowed characters in plain scalars | |||||
| Tags: scalar View source |
safe: a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~ !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~ safe question mark: ?foo safe colon: :foo safe dash: -foo |
$doc1 = {
"safe" => "a!\"#\$%&'()*+,-./09:;<=>?\@AZ[\\]^_`az{|}~ !\"#\$%&'()*+,-./09:;<=>?\@AZ[\\]^_`az{|}~",
"safe colon" => ":foo",
"safe dash" => "-foo",
"safe question mark" => "?foo",
}
|
Doc 1: {
"safe" : "a!\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~ !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~",
"safe colon" : ":foo",
"safe dash" : "-foo",
"safe question mark" : "?foo"
}
|
--- safe: a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~ !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~ safe colon: :foo safe dash: -foo safe question mark: ?foo |
safe: a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~ !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~ safe question mark: ?foo safe colon: :foo safe dash: -foo |
| FH7J - Tags on Empty Scalars | |||||
| Tags: scalar, tag View source |
- !!str - !!null : a b: !!str - !!str : !!null |
$doc1 = ["", { "" => "a", "b" => "" }, { "" => undef }]
|
Doc 1: [
"",
{
"" : "a",
"b" : ""
},
{
"" : null
}
]
|
--- - '' - '': a b: '' - '': null |
- !!str - !!null : a b: !!str - !!str : !!null |
| FP8R - Zero indented block scalar | |||||
| Tags: folded, indent, scalar View source |
--- > line1 line2 line3 |
$doc1 = "line1 line2 line3\n" |
Doc 1: "line1 line2 line3\n" |
--- | line1 line2 line3 |
--- > line1 line2 line3 |
| FQ7F - Spec Example 2.1. Sequence of Scalars | |||||
| Tags: sequence, spec View source |
- Mark McGwire - Sammy Sosa - Ken Griffey |
$doc1 = ["Mark McGwire", "Sammy Sosa", "Ken Griffey"] |
Doc 1: [ "Mark McGwire", "Sammy Sosa", "Ken Griffey" ] |
--- - Mark McGwire - Sammy Sosa - Ken Griffey |
- Mark McGwire - Sammy Sosa - Ken Griffey |
| FRK4 - Spec Example 7.3. Completely Empty Flow Nodes | |||||
| Tags: empty-key, explicit-key, flow, mapping, spec View source |
{ ? foo :, : bar, } |
$doc1 = { "" => "bar", "foo" => undef }
|
Doc 1: {
"" : "bar",
"foo" : null
}
|
--- '': bar foo: null |
{foo: , : bar} |
| FTA2 - Single block sequence with anchor and explicit document start | |||||
| Tags: anchor, header, sequence View source |
--- &sequence - a |
$doc1 = ["a"] |
Doc 1: [ "a" ] |
--- - a |
--- &sequence - a |
| FUP4 - Flow Sequence in Flow Sequence | |||||
| Tags: flow, sequence View source |
[a, [b, c]] |
$doc1 = ["a", ["b", "c"]] |
Doc 1: [
"a",
[
"b",
"c"
]
]
|
--- - a - - b - c |
- a - - b - c |
| G4RS - Spec Example 2.17. Quoted Scalars | |||||
| Tags: scalar, spec View source |
unicode: "Sosa did fine.\u263A" control: "\b1998\t1999\t2000\n" hex esc: "\x0d\x0a is \r\n" single: '"Howdy!" he cried.' quoted: ' # Not a ''comment''.' tie-fighter: '|\-*-/|' |
$doc1 = {
"control" => "\b1998\t1999\t2000\n",
"hex esc" => "\r\n is \r\n",
"quoted" => " # Not a 'comment'.",
"single" => "\"Howdy!\" he cried.",
"tie-fighter" => "|\\-*-/|",
"unicode" => "Sosa did fine.\x{263A}",
}
|
Doc 1: {
"control" : "\b1998\t1999\t2000\n",
"hex esc" : "\r\n is \r\n",
"quoted" : " # Not a 'comment'.",
"single" : "\"Howdy!\" he cried.",
"tie-fighter" : "|\\-*-/|",
"unicode" : "Sosa did fine.\u263a"
}
|
--- control: "\b1998\t1999\t2000\n" hex esc: "\r\n is \r\n" quoted: " # Not a 'comment'." single: '"Howdy!" he cried.' tie-fighter: '|\-*-/|' unicode: Sosa did fine.☺ |
unicode: "Sosa did fine.☺" control: "\b1998\t1999\t2000\n" hex esc: "\r\n is \r\n" single: '"Howdy!" he cried.' quoted: ' # Not a ''comment''.' tie-fighter: '|\-*-/|' |
| G992 - Spec Example 8.9. Folded Scalar | |||||
| Tags: 1.3-err, folded, scalar, spec View source |
> folded text |
$doc1 = "folded text\n" |
Doc 1: "folded text\n" |
--- | folded text |
> folded text |
| GH63 - Mixed Block Mapping (explicit to implicit) | |||||
| Tags: explicit-key, mapping View source |
? a : 1.3 fifteen: d |
$doc1 = { a => 1.3, fifteen => "d" }
|
Doc 1: {
"a" : 1.3,
"fifteen" : "d"
}
|
--- a: 1.3 fifteen: d |
a: 1.3 fifteen: d |
| H2RW - Blank lines | |||||
| Tags: comment, literal, scalar, whitespace View source |
foo: 1 bar: 2 text: | a b c d |
$doc1 = { bar => 2, foo => 1, text => "a\n \nb\n\nc\n\nd\n" }
|
Doc 1: {
"bar" : 2,
"foo" : 1,
"text" : "a\n \nb\n\nc\n\nd\n"
}
|
--- bar: 2 foo: 1 text: | a b c d |
foo: 1 bar: 2 text: | a b c d |
| H3Z8 - Literal unicode | |||||
| Tags: scalar View source |
--- wanted: love ♥ and peace ☮ |
$doc1 = { wanted => "love \x{2665} and peace \x{262E}" }
|
Doc 1: {
"wanted" : "love \u2665 and peace \u262e"
}
|
--- wanted: love ♥ and peace ☮ |
--- wanted: love ♥ and peace ☮ |
| HM87/00 - Scalars in flow start with syntax char | |||||
| Tags: View source |
[:x] |
$doc1 = [":x"] |
Doc 1: [ ":x" ] |
--- - :x |
- :x |
| HM87/01 - Scalars in flow start with syntax char | |||||
| Tags: View source |
[?x] |
$doc1 = ["?x"] |
Doc 1: [ "?x" ] |
--- - ?x |
- ?x |
| HMK4 - Spec Example 2.16. Indentation determines scope | |||||
| Tags: folded, literal, spec View source |
name: Mark McGwire accomplishment: > Mark set a major league home run record in 1998. stats: | 65 Home Runs 0.278 Batting Average |
$doc1 = {
accomplishment => "Mark set a major league home run record in 1998.\n",
name => "Mark McGwire",
stats => "65 Home Runs\n0.278 Batting Average\n",
}
|
Doc 1: {
"accomplishment" : "Mark set a major league home run record in 1998.\n",
"name" : "Mark McGwire",
"stats" : "65 Home Runs\n0.278 Batting Average\n"
}
|
--- accomplishment: | Mark set a major league home run record in 1998. name: Mark McGwire stats: | 65 Home Runs 0.278 Batting Average |
name: Mark McGwire accomplishment: > Mark set a major league home run record in 1998. stats: | 65 Home Runs 0.278 Batting Average |
| HMQ5 - Spec Example 6.23. Node Properties | |||||
| Tags: alias, spec, tag View source |
!!str &a1 "foo": !!str bar &a2 baz : *a1 |
$doc1 = { baz => "foo", foo => "bar" }
|
Doc 1: {
"baz" : "foo",
"foo" : "bar"
}
|
--- baz: foo foo: bar |
&a1 !!str "foo": !!str bar &a2 baz: *a1 |
| HS5T - Spec Example 7.12. Plain Lines | |||||
| Tags: scalar, spec, upto-1.2, whitespace View source |
1st non-empty 2nd non-empty 3rd non-empty |
$doc1 = "1st non-empty\n2nd non-empty 3rd non-empty" |
Doc 1: "1st non-empty\n2nd non-empty 3rd non-empty" |
--- |- 1st non-empty 2nd non-empty 3rd non-empty |
|- 1st non-empty 2nd non-empty 3rd non-empty |
| HWV9 - Document-end marker | |||||
| Tags: footer View source |
... |
||||
| J3BT - Spec Example 5.12. Tabs and Spaces | |||||
| Tags: spec, upto-1.2, whitespace View source |
# Tabs and spaces quoted: "Quoted " block: | void main() { printf("Hello, world!\n"); } |
$doc1 = {
block => "void main() {\n\tprintf(\"Hello, world!\\n\");\n}\n",
quoted => "Quoted \t",
}
|
Doc 1: {
"block" : "void main() {\n\tprintf(\"Hello, world!\\n\");\n}\n",
"quoted" : "Quoted \t"
}
|
--- block: "void main() {\n\tprintf(\"Hello, world!\\n\");\n}\n" quoted: "Quoted \t" |
quoted: "Quoted \t" block: | void main() { printf("Hello, world!\n"); } |
| J5UC - Multiple Pair Block Mapping | |||||
| Tags: mapping View source |
foo: blue bar: arrr baz: jazz |
$doc1 = { bar => "arrr", baz => "jazz", foo => "blue" }
|
Doc 1: {
"bar" : "arrr",
"baz" : "jazz",
"foo" : "blue"
}
|
--- bar: arrr baz: jazz foo: blue |
foo: blue bar: arrr baz: jazz |
| J7PZ - Spec Example 2.26. Ordered Mappings | |||||
| Tags: mapping, spec, tag, unknown-tag View source |
# The !!omap tag is one of the optional types # introduced for YAML 1.1. In 1.2, it is not # part of the standard tags and should not be # enabled by default. # Ordered maps are represented as # A sequence of mappings, with # each mapping having one key --- !!omap - Mark McGwire: 65 - Sammy Sosa: 63 - Ken Griffy: 58 |
$doc1 = [
{ "Mark McGwire" => 65 },
{ "Sammy Sosa" => 63 },
{ "Ken Griffy" => 58 },
]
|
Doc 1: [
{
"Mark McGwire" : 65
},
{
"Sammy Sosa" : 63
},
{
"Ken Griffy" : 58
}
]
|
--- - Mark McGwire: 65 - Sammy Sosa: 63 - Ken Griffy: 58 |
--- !!omap - Mark McGwire: 65 - Sammy Sosa: 63 - Ken Griffy: 58 |
| J7VC - Empty Lines Between Mapping Elements | |||||
| Tags: mapping, whitespace View source |
one: 2 three: 4 |
$doc1 = { one => 2, three => 4 }
|
Doc 1: {
"one" : 2,
"three" : 4
}
|
--- one: 2 three: 4 |
one: 2 three: 4 |
| J9HZ - Spec Example 2.9. Single Document with Two Comments | |||||
| Tags: comment, mapping, sequence, spec View source |
--- hr: # 1998 hr ranking - Mark McGwire - Sammy Sosa rbi: # 1998 rbi ranking - Sammy Sosa - Ken Griffey |
$doc1 = {
hr => ["Mark McGwire", "Sammy Sosa"],
rbi => ["Sammy Sosa", "Ken Griffey"],
}
|
Doc 1: {
"hr" : [
"Mark McGwire",
"Sammy Sosa"
],
"rbi" : [
"Sammy Sosa",
"Ken Griffey"
]
}
|
--- hr: - Mark McGwire - Sammy Sosa rbi: - Sammy Sosa - Ken Griffey |
--- hr: - Mark McGwire - Sammy Sosa rbi: - Sammy Sosa - Ken Griffey |
| JEF9/00 - Trailing whitespace in streams | |||||
| Tags: View source |
- |+ |
$doc1 = ["\n\n"] |
Doc 1: [ "\n\n" ] |
--- - "\n\n" |
- |+ ... |
| JEF9/01 - Trailing whitespace in streams | |||||
| Tags: View source |
- |+ |
$doc1 = ["\n"] |
Doc 1: [ "\n" ] |
--- - "\n" |
- |+ ... |
| JEF9/02 - Trailing whitespace in streams | |||||
| Tags: View source |
- |+ |
$doc1 = ["\n"] |
Doc 1: [ "\n" ] |
--- - "\n" |
- |+ ... |
| JHB9 - Spec Example 2.7. Two Documents in a Stream | |||||
| Tags: header, spec View source |
# Ranking of 1998 home runs --- - Mark McGwire - Sammy Sosa - Ken Griffey # Team ranking --- - Chicago Cubs - St Louis Cardinals |
$doc1 = ["Mark McGwire", "Sammy Sosa", "Ken Griffey"] $doc2 = ["Chicago Cubs", "St Louis Cardinals"] |
Doc 1: [ "Mark McGwire", "Sammy Sosa", "Ken Griffey" ] Doc 2: [ "Chicago Cubs", "St Louis Cardinals" ] |
--- - Mark McGwire - Sammy Sosa - Ken Griffey --- - Chicago Cubs - St Louis Cardinals |
--- - Mark McGwire - Sammy Sosa - Ken Griffey --- - Chicago Cubs - St Louis Cardinals |
| JQ4R - Spec Example 8.14. Block Sequence | |||||
| Tags: mapping, sequence, spec View source |
block sequence: - one - two : three |
$doc1 = { "block sequence" => ["one", { two => "three" }] }
|
Doc 1: {
"block sequence" : [
"one",
{
"two" : "three"
}
]
}
|
--- block sequence: - one - two: three |
block sequence: - one - two: three |
| JR7V - Question marks in scalars | |||||
| Tags: flow, scalar View source |
- a?string - another ? string - key: value? - [a?string] - [another ? string] - {key: value? } - {key: value?} - {key?: value } |
$doc1 = [
"a?string",
"another ? string",
{ key => "value?" },
["a?string"],
["another ? string"],
{ key => "value?" },
{ key => "value?" },
{ "key?" => "value" },
]
|
Doc 1: [
"a?string",
"another ? string",
{
"key" : "value?"
},
[
"a?string"
],
[
"another ? string"
],
{
"key" : "value?"
},
{
"key" : "value?"
},
{
"key?" : "value"
}
]
|
--- - a?string - another ? string - key: value? - - a?string - - another ? string - key: value? - key: value? - key?: value |
- a?string - another ? string - key: value? - - a?string - - another ? string - {key: value?} - {key: value?} - {key?: value} |
| JS2J - Spec Example 6.29. Node Anchors | |||||
| Tags: alias, spec View source |
First occurrence: &anchor Value Second occurrence: *anchor |
$doc1 = { "First occurrence" => "Value", "Second occurrence" => "Value" }
|
Doc 1: {
"First occurrence" : "Value",
"Second occurrence" : "Value"
}
|
--- First occurrence: Value Second occurrence: Value |
First occurrence: &anchor Value Second occurrence: *anchor |
| JTV5 - Block Mapping with Multiline Scalars | |||||
| Tags: explicit-key, mapping, scalar View source |
? a true : null d ? e 42 |
$doc1 = { "a true" => "null d", "e 42" => undef }
|
Doc 1: {
"a true" : "null d",
"e 42" : null
}
|
--- a true: null d e 42: null |
a true: null d e 42: |
| K3WX - Colon and adjacent value after comment on next line | |||||
| Tags: comment, flow, mapping View source |
--- { "foo" # comment :bar } |
$doc1 = { foo => "bar" }
|
Doc 1: {
"foo" : "bar"
}
|
--- foo: bar |
--- {"foo": bar} |
| K4SU - Multiple Entry Block Sequence | |||||
| Tags: sequence View source |
- foo - bar - 42 |
$doc1 = ["foo", "bar", 42] |
Doc 1: [ "foo", "bar", 42 ] |
--- - foo - bar - 42 |
- foo - bar - 42 |
| K527 - Spec Example 6.6. Line Folding | |||||
| Tags: 1.3-err, folded, scalar, spec, whitespace View source |
>- trimmed as space |
$doc1 = "trimmed\n\n\nas space" |
Doc 1: "trimmed\n\n\nas space" |
--- |- trimmed as space |
>- trimmed as space |
| K54U - Tab after document header | |||||
| Tags: header, whitespace View source |
--- scalar |
$doc1 = "scalar" |
Doc 1: "scalar" |
--- scalar |
--- scalar |
| K858 - Spec Example 8.6. Empty Scalar Chomping | |||||
| Tags: folded, literal, spec, whitespace View source |
strip: >- clip: > keep: |+ |
$doc1 = { clip => "", keep => "\n", strip => "" }
|
Doc 1: {
"clip" : "",
"keep" : "\n",
"strip" : ""
}
|
--- clip: '' keep: "\n" strip: '' |
strip: "" clip: "" keep: |+ ... |
| KH5V/00 - Inline tabs in double quoted | |||||
| Tags: View source |
"1 inline\ttab" |
$doc1 = "1 inline\ttab" |
Doc 1: "1 inline\ttab" |
--- "1 inline\ttab" |
"1 inline\ttab" |
| KH5V/01 - Inline tabs in double quoted | |||||
| Tags: View source |
"2 inline\ tab" |
$doc1 = "2 inline\ttab" |
Doc 1: "2 inline\ttab" |
--- "2 inline\ttab" |
"2 inline\ttab" |
| KH5V/02 - Inline tabs in double quoted | |||||
| Tags: View source |
"3 inline tab" |
$doc1 = "3 inline\ttab" |
Doc 1: "3 inline\ttab" |
--- "3 inline\ttab" |
"3 inline\ttab" |
| KK5P - Various combinations of explicit block mappings | |||||
| Tags: explicit-key, mapping, sequence View source |
complex1: ? - a complex2: ? - a : b complex3: ? - a : > b complex4: ? > a : complex5: ? - a : - b |
$doc1 = {
complex1 => { "['a']" => undef },
complex2 => { "['a']" => "b" },
complex3 => { "['a']" => "b\n" },
complex4 => { "a\n" => undef },
complex5 => { "['a']" => ["b"] },
}
|
Doc 1: {
"complex1" : {
"['a']" : null
},
"complex2" : {
"['a']" : "b"
},
"complex3" : {
"['a']" : "b\n"
},
"complex4" : {
"a\n" : null
},
"complex5" : {
"['a']" : [
"b"
]
}
}
|
--- complex1: "['a']": null complex2: "['a']": b complex3: "['a']": | b complex4: ? | a : null complex5: "['a']": - b |
complex1: ? - a : complex2: ? - a : b complex3: ? - a : > b complex4: ? > a : complex5: ? - a : - b |
| KMK3 - Block Submapping | |||||
| Tags: mapping View source |
foo: bar: 1 baz: 2 |
$doc1 = { baz => 2, foo => { bar => 1 } }
|
Doc 1: {
"baz" : 2,
"foo" : {
"bar" : 1
}
}
|
--- baz: 2 foo: bar: 1 |
foo: bar: 1 baz: 2 |
| KSS4 - Scalars on --- line | |||||
| Tags: 1.3-err, anchor, header, scalar View source |
--- "quoted string" --- &node foo |
$doc1 = "quoted string" $doc2 = "foo" |
Doc 1: "quoted string" Doc 2: "foo" |
--- quoted string --- foo |
--- "quoted string" --- &node foo |
| L24T/00 - Trailing line of spaces | |||||
| Tags: View source |
foo: | x |
$doc1 = { foo => "x\n \n" }
|
Doc 1: {
"foo" : "x\n \n"
}
|
--- foo: | x |
foo: | x |
| L24T/01 - Trailing line of spaces | |||||
| Tags: View source |
foo: | x |
$doc1 = { foo => "x\n \n" }
|
Doc 1: {
"foo" : "x\n \n"
}
|
--- foo: | x |
foo: | x |
| L383 - Two scalar docs with trailing comments | |||||
| Tags: comment View source |
--- foo # comment --- foo # comment |
$doc1 = "foo" $doc2 = "foo" |
Doc 1: "foo" Doc 2: "foo" |
--- foo --- foo |
--- foo --- foo |
| L94M - Tags in Explicit Mapping | |||||
| Tags: explicit-key, mapping, tag View source |
? !!str a : !!int 47 ? c : !!str d |
$doc1 = { a => 47, c => "d" }
|
Doc 1: {
"a" : 47,
"c" : "d"
}
|
--- a: 47 c: d |
!!str a: !!int 47 c: !!str d |
| L9U5 - Spec Example 7.11. Plain Implicit Keys | |||||
| Tags: flow, mapping, spec View source |
implicit block key : [ implicit flow key : value, ] |
$doc1 = { "implicit block key" => [{ "implicit flow key" => "value" }] }
|
Doc 1: {
"implicit block key" : [
{
"implicit flow key" : "value"
}
]
}
|
--- implicit block key: - implicit flow key: value |
implicit block key: - {implicit flow key: value} |
| LE5A - Spec Example 7.24. Flow Nodes | |||||
| Tags: alias, spec, tag View source |
- !!str "a" - 'b' - &anchor "c" - *anchor - !!str |
$doc1 = ["a", "b", "c", "c", ""] |
Doc 1: [ "a", "b", "c", "c", "" ] |
--- - a - b - c - c - '' |
- !!str "a" - 'b' - &anchor "c" - *anchor - !!str |
| LP6E - Whitespace After Scalars in Flow | |||||
| Tags: flow, scalar, whitespace View source |
- [a, b , c ] - { "a" : b , c : 'd' , e : "f" } - [ ] |
$doc1 = [["a", "b", "c"], { a => "b", c => "d", e => "f" }, []]
|
Doc 1: [
[
"a",
"b",
"c"
],
{
"a" : "b",
"c" : "d",
"e" : "f"
},
[]
]
|
--- - - a - b - c - a: b c: d e: f - [] |
- - a - b - c - {"a": b, c: 'd', e: "f"} - [] |
| LQZ7 - Spec Example 7.4. Double Quoted Implicit Keys | |||||
| Tags: flow, scalar, spec View source |
"implicit block key" : [ "implicit flow key" : value, ] |
$doc1 = { "implicit block key" => [{ "implicit flow key" => "value" }] }
|
Doc 1: {
"implicit block key" : [
{
"implicit flow key" : "value"
}
]
}
|
--- implicit block key: - implicit flow key: value |
"implicit block key": - {"implicit flow key": value} |
| LX3P - Implicit Flow Mapping Key on one line | |||||
| Tags: 1.3-err, complex-key, flow, mapping, sequence View source |
[flow]: block Line : 1 Column : 7 Expected : EOL Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ": block\n" at YAML/PP/Loader.pm line 94. |
||||
| M29M - Literal Block Scalar | |||||
| Tags: literal, scalar, whitespace View source |
a: | ab cd ef ... |
$doc1 = { a => "ab\n\ncd\nef\n" }
|
Doc 1: {
"a" : "ab\n\ncd\nef\n"
}
|
--- a: | ab cd ef |
a: | ab cd ef ... |
| M2N8/00 - Question mark edge cases | |||||
| Tags: View source |
- ? : x |
$doc1 = [{ "{'' => 'x'}" => undef }]
|
Doc 1: [
{
"{'' => 'x'}" : null
}
]
|
--- - "{'' => 'x'}": null |
- ? : x : |
| M2N8/01 - Question mark edge cases | |||||
| Tags: View source |
? []: x Line : 1 Column : 5 Expected : EOL Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ": x\n" at YAML/PP/Loader.pm line 94. |
||||
| M5C3 - Spec Example 8.21. Block Scalar Nodes | |||||
| Tags: 1.3-err, folded, indent, literal, local-tag, spec, tag View source |
literal: |2 value folded: !foo >1 value |
$doc1 = { folded => "value\n", literal => "value\n" }
|
Doc 1: {
"folded" : "value\n",
"literal" : "value\n"
}
|
--- folded: | value literal: | value |
literal: | value folded: !foo > value |
| M5DY - Spec Example 2.11. Mapping between Sequences | |||||
| Tags: complex-key, explicit-key, mapping, sequence, spec View source |
? - Detroit Tigers - Chicago cubs : - 2001-07-23 ? [ New York Yankees, Atlanta Braves ] : [ 2001-07-02, 2001-08-12, 2001-08-14 ] |
$doc1 = {
"['Detroit Tigers','Chicago cubs']" => ["2001-07-23"],
"['New York Yankees','Atlanta Braves']" => ["2001-07-02", "2001-08-12", "2001-08-14"],
}
|
Doc 1: {
"['Detroit Tigers','Chicago cubs']" : [
"2001-07-23"
],
"['New York Yankees','Atlanta Braves']" : [
"2001-07-02",
"2001-08-12",
"2001-08-14"
]
}
|
--- "['Detroit Tigers','Chicago cubs']": - 2001-07-23 "['New York Yankees','Atlanta Braves']": - 2001-07-02 - 2001-08-12 - 2001-08-14 |
? - Detroit Tigers - Chicago cubs : - 2001-07-23 ? - New York Yankees - Atlanta Braves : - 2001-07-02 - 2001-08-12 - 2001-08-14 |
| M6YH - Block sequence indentation | |||||
| Tags: indent View source |
- | x - foo: bar - - 42 |
$doc1 = ["x\n", { foo => "bar" }, [42]]
|
Doc 1: [
"x\n",
{
"foo" : "bar"
},
[
42
]
]
|
--- - | x - foo: bar - - 42 |
- | x - foo: bar - - 42 |
| M7A3 - Spec Example 9.3. Bare Documents | |||||
| Tags: 1.3-err, footer, spec View source |
Bare document ... # No document ... | %!PS-Adobe-2.0 # Not the first line |
$doc1 = "Bare document" $doc2 = "%!PS-Adobe-2.0 # Not the first line\n" |
Doc 1: "Bare document" Doc 2: "%!PS-Adobe-2.0 # Not the first line\n" |
--- Bare document --- | %!PS-Adobe-2.0 # Not the first line |
Bare document ... | %!PS-Adobe-2.0 # Not the first line |
| M7NX - Nested flow collections | |||||
| Tags: flow, mapping, sequence View source |
--- { a: [ b, c, { d: [e, f] } ] } |
$doc1 = { a => ["b", "c", { d => ["e", "f"] }] }
|
Doc 1: {
"a" : [
"b",
"c",
{
"d" : [
"e",
"f"
]
}
]
}
|
--- a: - b - c - d: - e - f |
--- {a: [b, c, {d: [e, f]}]} |
| M9B4 - Spec Example 8.7. Literal Scalar | |||||
| Tags: 1.3-err, literal, scalar, spec, whitespace View source |
| literal text |
$doc1 = "literal\n\ttext\n" |
Doc 1: "literal\n\ttext\n" |
--- "literal\n\ttext\n" |
| literal text |
| MJS9 - Spec Example 6.7. Block Folding | |||||
| Tags: 1.3-err, folded, scalar, spec, whitespace View source |
> foo bar baz |
$doc1 = "foo \n\n\t bar\n\nbaz\n" |
Doc 1: "foo \n\n\t bar\n\nbaz\n" |
--- "foo \n\n\t bar\n\nbaz\n" |
> foo bar baz |
| MUS6/02 - Directive variants | |||||
| Tags: View source |
%YAML 1.1 --- |
$doc1 = undef |
Doc 1: null |
--- null |
%YAML 1.1 --- |
| MUS6/03 - Directive variants | |||||
| Tags: View source |
%YAML 1.1 --- |
$doc1 = undef |
Doc 1: null |
--- null |
%YAML 1.1 --- |
| MUS6/04 - Directive variants | |||||
| Tags: View source |
%YAML 1.1 # comment --- |
$doc1 = undef |
Doc 1: null |
--- null |
%YAML 1.1 --- |
| MUS6/05 - Directive variants | |||||
| Tags: View source |
%YAM 1.1 --- |
$doc1 = undef |
Doc 1: null |
--- null |
--- |
| MUS6/06 - Directive variants | |||||
| Tags: View source |
%YAMLL 1.1 --- |
$doc1 = undef |
Doc 1: null |
--- null |
--- |
| MXS3 - Flow Mapping in Block Sequence | |||||
| Tags: flow, mapping, sequence View source |
- {a: b} |
$doc1 = [{ a => "b" }]
|
Doc 1: [
{
"a" : "b"
}
]
|
--- - a: b |
- {a: b} |
| MYW6 - Block Scalar Strip | |||||
| Tags: 1.3-err, literal, scalar, whitespace View source |
|- ab ... |
$doc1 = "ab" |
Doc 1: "ab" |
--- ab |
|- ab ... |
| MZX3 - Non-Specific Tags on Scalars | |||||
| Tags: folded, scalar View source |
- plain - "double quoted" - 'single quoted' - > block - plain again |
$doc1 = [ "plain", "double quoted", "single quoted", "block\n", "plain again", ] |
Doc 1: [ "plain", "double quoted", "single quoted", "block\n", "plain again" ] |
--- - plain - double quoted - single quoted - | block - plain again |
- plain - "double quoted" - 'single quoted' - > block - plain again |
| NAT4 - Various empty or newline only quoted strings | |||||
| Tags: double, scalar, single, whitespace View source |
--- a: ' ' b: ' ' c: " " d: " " e: ' ' f: " " g: ' ' h: " " |
$doc1 = { a => " ", b => " ", c => " ", d => " ", e => "\n", f => "\n", g => "\n\n", h => "\n\n" }
|
Doc 1: {
"a" : " ",
"b" : " ",
"c" : " ",
"d" : " ",
"e" : "\n",
"f" : "\n",
"g" : "\n\n",
"h" : "\n\n"
}
|
--- a: ' ' b: ' ' c: ' ' d: ' ' e: "\n" f: "\n" g: "\n\n" h: "\n\n" |
--- a: ' ' b: ' ' c: " " d: " " e: "\n" f: "\n" g: "\n\n" h: "\n\n" |
| NB6Z - Multiline plain value with tabs on empty lines | |||||
| Tags: scalar, whitespace View source |
key: value with tabs |
$doc1 = { key => "value with\ntabs" }
|
Doc 1: {
"key" : "value with\ntabs"
}
|
--- key: |- value with tabs |
key: |- value with tabs |
| NHX8 - Empty Lines at End of Document | |||||
| Tags: empty-key, whitespace View source |
: |
$doc1 = { "" => undef }
|
Doc 1: {
"" : null
}
|
--- '': null |
: |
| NJ66 - Multiline plain flow mapping key | |||||
| Tags: flow, mapping View source |
--- - { single line: value} - { multi line: value} |
$doc1 = [{ "single line" => "value" }, { "multi line" => "value" }]
|
Doc 1: [
{
"single line" : "value"
},
{
"multi line" : "value"
}
]
|
--- - single line: value - multi line: value |
--- - {single line: value} - {multi line: value} |
| NKF9 - Empty keys in block and flow mapping | |||||
| Tags: empty-key, mapping View source |
--- key: value : empty key --- { key: value, : empty key } --- # empty key and value : --- # empty key and value { : } |
$doc1 = { "" => "empty key", "key" => "value" }
$doc2 = { "" => "empty key", "key" => "value" }
$doc3 = { "" => undef }
$doc4 = { "" => undef }
|
Doc 1: {
"" : "empty key",
"key" : "value"
}
Doc 2: {
"" : "empty key",
"key" : "value"
}
Doc 3: {
"" : null
}
Doc 4: {
"" : null
}
|
--- '': empty key key: value --- '': empty key key: value --- '': null --- '': null |
--- key: value : empty key --- {key: value, : empty key} --- : --- {: } |
| NP9H - Spec Example 7.5. Double Quoted Line Breaks | |||||
| Tags: double, scalar, spec, upto-1.2, whitespace View source |
"folded to a space, to a line feed, or \ \ non-content" |
$doc1 = "folded to a space,\nto a line feed, or \t \tnon-content" |
Doc 1: "folded to a space,\nto a line feed, or \t \tnon-content" |
--- "folded to a space,\nto a line feed, or \t \tnon-content" |
"folded to a space,\nto a line feed, or \t \tnon-content" |
| P2AD - Spec Example 8.1. Block Scalar Header | |||||
| Tags: comment, folded, literal, scalar, spec View source |
- | # Empty header↓ literal - >1 # Indentation indicator↓ folded - |+ # Chomping indicator↓ keep - >1- # Both indicators↓ strip |
$doc1 = ["literal\n", " folded\n", "keep\n\n", " strip"] |
Doc 1: [ "literal\n", " folded\n", "keep\n\n", " strip" ] |
--- - | literal - |2 folded - |+ keep - ' strip' |
- | literal - >2 folded - |+ keep - >2- strip |
| P76L - Spec Example 6.19. Secondary Tag Handle | |||||
| Tags: header, spec, tag, unknown-tag View source |
%TAG !! tag:example.com,2000:app/ --- !!int 1 - 3 # Interval, not integer |
$doc1 = "1 - 3" |
Doc 1: "1 - 3" |
--- 1 - 3 |
--- !<tag:example.com,2000:app/int> 1 - 3 |
| P94K - Spec Example 6.11. Multi-Line Comments | |||||
| Tags: comment, spec View source |
key: # Comment # lines value |
$doc1 = { key => "value" }
|
Doc 1: {
"key" : "value"
}
|
--- key: value |
key: value |
| PBJ2 - Spec Example 2.3. Mapping Scalars to Sequences | |||||
| Tags: mapping, sequence, spec View source |
american: - Boston Red Sox - Detroit Tigers - New York Yankees national: - New York Mets - Chicago Cubs - Atlanta Braves |
$doc1 = {
american => ["Boston Red Sox", "Detroit Tigers", "New York Yankees"],
national => ["New York Mets", "Chicago Cubs", "Atlanta Braves"],
}
|
Doc 1: {
"american" : [
"Boston Red Sox",
"Detroit Tigers",
"New York Yankees"
],
"national" : [
"New York Mets",
"Chicago Cubs",
"Atlanta Braves"
]
}
|
--- american: - Boston Red Sox - Detroit Tigers - New York Yankees national: - New York Mets - Chicago Cubs - Atlanta Braves |
american: - Boston Red Sox - Detroit Tigers - New York Yankees national: - New York Mets - Chicago Cubs - Atlanta Braves |
| PRH3 - Spec Example 7.9. Single Quoted Lines | |||||
| Tags: scalar, single, spec, upto-1.2, whitespace View source |
' 1st non-empty 2nd non-empty 3rd non-empty ' |
$doc1 = " 1st non-empty\n2nd non-empty 3rd non-empty " |
Doc 1: " 1st non-empty\n2nd non-empty 3rd non-empty " |
--- |2- 1st non-empty 2nd non-empty 3rd non-empty |
' 1st non-empty 2nd non-empty 3rd non-empty ' |
| PUW8 - Document start on last line | |||||
| Tags: header View source |
--- a: b --- |
$doc1 = { a => "b" }
$doc2 = undef
|
Doc 1: {
"a" : "b"
}
Doc 2: null
|
--- a: b --- null |
--- a: b --- |
| PW8X - Anchors on Empty Scalars | |||||
| Tags: anchor, explicit-key View source |
- &a - a - &a : a b: &b - &c : &a - ? &d - ? &e : &a |
$doc1 = [
undef,
"a",
{ "" => "a", "b" => undef },
{ "" => undef },
{ "" => undef },
{ "" => undef },
]
|
Doc 1: [
null,
"a",
{
"" : "a",
"b" : null
},
{
"" : null
},
{
"" : null
},
{
"" : null
}
]
|
--- - null - a - '': a b: null - '': null - '': null - '': null |
- &a - a - &a : a b: &b - &c : &a - &d : - &e : &a |
| Q5MG - Tab at beginning of line followed by a flow mapping | |||||
| Tags: flow, whitespace View source |
{} |
$doc1 = {}
|
Doc 1: {}
|
--- {} |
{} |
| Q88A - Spec Example 7.23. Flow Content | |||||
| Tags: flow, mapping, sequence, spec View source |
- [ a, b ] - { a: b } - "a" - 'b' - c |
$doc1 = [["a", "b"], { a => "b" }, "a", "b", "c"]
|
Doc 1: [
[
"a",
"b"
],
{
"a" : "b"
},
"a",
"b",
"c"
]
|
--- - - a - b - a: b - a - b - c |
- - a - b - {a: b} - "a" - 'b' - c |
| Q8AD - Spec Example 7.5. Double Quoted Line Breaks [1.3] | |||||
| Tags: 1.3-mod, double, scalar, spec, whitespace View source |
--- "folded to a space, to a line feed, or \ \ non-content" |
$doc1 = "folded to a space,\nto a line feed, or \t \tnon-content" |
Doc 1: "folded to a space,\nto a line feed, or \t \tnon-content" |
--- "folded to a space,\nto a line feed, or \t \tnon-content" |
--- "folded to a space,\nto a line feed, or \t \tnon-content" |
| Q9WF - Spec Example 6.12. Separation Spaces | |||||
| Tags: 1.3-err, comment, complex-key, flow, spec, whitespace View source |
{ first: Sammy, last: Sosa }: # Statistics: hr: # Home runs 65 avg: # Average 0.278 Line : 1 Column : 29 Expected : EOL Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ":" at YAML/PP/Loader.pm line 94. |
||||
| QF4Y - Spec Example 7.19. Single Pair Flow Mappings | |||||
| Tags: flow, mapping, spec View source |
[ foo: bar ] |
$doc1 = [{ foo => "bar" }]
|
Doc 1: [
{
"foo" : "bar"
}
]
|
--- - foo: bar |
- {foo: bar} |
| QT73 - Comment and document-end marker | |||||
| Tags: comment, footer View source |
# comment ... |
||||
| R4YG - Spec Example 8.2. Block Indentation Indicator | |||||
| Tags: folded, libyaml-err, literal, scalar, spec, upto-1.2, whitespace View source |
- | detected - > # detected - |1 explicit - > detected |
$doc1 = [ "detected\n", "\n\n# detected\n", " explicit\n", "\t\ndetected\n", ] |
Doc 1: [ "detected\n", "\n\n# detected\n", " explicit\n", "\t\ndetected\n" ] |
--- - | detected - | # detected - |2 explicit - "\t\ndetected\n" |
- | detected - > # detected - |2 explicit - > detected |
| R52L - Nested flow mapping sequence and mappings | |||||
| Tags: flow, mapping, sequence View source |
--- { top1: [item1, {key2: value2}, item3], top2: value2 } |
$doc1 = { top1 => ["item1", { key2 => "value2" }, "item3"], top2 => "value2" }
|
Doc 1: {
"top1" : [
"item1",
{
"key2" : "value2"
},
"item3"
],
"top2" : "value2"
}
|
--- top1: - item1 - key2: value2 - item3 top2: value2 |
--- {top1: [item1, {key2: value2}, item3], top2: value2} |
| RLU9 - Sequence Indent | |||||
| Tags: indent, sequence View source |
foo: - 42 bar: - 44 |
$doc1 = { bar => [44], foo => [42] }
|
Doc 1: {
"bar" : [
44
],
"foo" : [
42
]
}
|
--- bar: - 44 foo: - 42 |
foo: - 42 bar: - 44 |
| RR7F - Mixed Block Mapping (implicit to explicit) | |||||
| Tags: explicit-key, mapping View source |
a: 4.2 ? d : 23 |
$doc1 = { a => 4.2, d => 23 }
|
Doc 1: {
"a" : 4.2,
"d" : 23
}
|
--- a: 4.2 d: 23 |
a: 4.2 d: 23 |
| RTP8 - Spec Example 9.2. Document Markers | |||||
| Tags: footer, header, spec View source |
%YAML 1.2 --- Document ... # Suffix |
$doc1 = "Document" |
Doc 1: "Document" |
--- Document |
%YAML 1.2 --- Document ... |
| RZP5 - Various Trailing Comments [1.3] | |||||
| Tags: 1.3-mod, anchor, comment, folded, mapping View source |
a: "double quotes" # lala b: plain value # lala c : #lala d ? # lala - seq1 : # lala - #lala seq2 e: &node # lala - x: y block: > # lala abcde |
$doc1 = {
"['seq1']" => ["seq2"],
"a" => "double quotes",
"b" => "plain value",
"block" => "abcde\n",
"c" => "d",
"e" => [{ x => "y" }],
}
|
Doc 1: {
"['seq1']" : [
"seq2"
],
"a" : "double quotes",
"b" : "plain value",
"block" : "abcde\n",
"c" : "d",
"e" : [
{
"x" : "y"
}
]
}
|
--- "['seq1']": - seq2 a: double quotes b: plain value block: | abcde c: d e: - x: y |
a: "double quotes" b: plain value c: d ? - seq1 : - seq2 e: &node - x: y block: > abcde |
| RZT7 - Spec Example 2.28. Log File | |||||
| Tags: header, literal, mapping, sequence, spec View source |
--- Time: 2001-11-23 15:01:42 -5 User: ed Warning: This is an error message for the log file --- Time: 2001-11-23 15:02:31 -5 User: ed Warning: A slightly different error message. --- Date: 2001-11-23 15:03:17 -5 User: ed Fatal: Unknown variable "bar" Stack: - file: TopClass.py line: 23 code: | x = MoreObject("345\n") - file: MoreClass.py line: 58 code: |- foo = bar |
$doc1 = {
Time => "2001-11-23 15:01:42 -5",
User => "ed",
Warning => "This is an error message for the log file",
}
$doc2 = {
Time => "2001-11-23 15:02:31 -5",
User => "ed",
Warning => "A slightly different error message.",
}
$doc3 = {
Date => "2001-11-23 15:03:17 -5",
Fatal => "Unknown variable \"bar\"",
Stack => [
{
code => "x = MoreObject(\"345\\n\")\n",
file => "TopClass.py",
line => 23,
},
{ code => "foo = bar", file => "MoreClass.py", line => 58 },
],
User => "ed",
}
|
Doc 1: {
"Time" : "2001-11-23 15:01:42 -5",
"User" : "ed",
"Warning" : "This is an error message for the log file"
}
Doc 2: {
"Time" : "2001-11-23 15:02:31 -5",
"User" : "ed",
"Warning" : "A slightly different error message."
}
Doc 3: {
"Date" : "2001-11-23 15:03:17 -5",
"Fatal" : "Unknown variable \"bar\"",
"Stack" : [
{
"code" : "x = MoreObject(\"345\\n\")\n",
"file" : "TopClass.py",
"line" : 23
},
{
"code" : "foo = bar",
"file" : "MoreClass.py",
"line" : 58
}
],
"User" : "ed"
}
|
--- Time: 2001-11-23 15:01:42 -5 User: ed Warning: This is an error message for the log file --- Time: 2001-11-23 15:02:31 -5 User: ed Warning: A slightly different error message. --- Date: 2001-11-23 15:03:17 -5 Fatal: Unknown variable "bar" Stack: - code: | x = MoreObject("345\n") file: TopClass.py line: 23 - code: foo = bar file: MoreClass.py line: 58 User: ed |
--- Time: 2001-11-23 15:01:42 -5 User: ed Warning: This is an error message for the log file --- Time: 2001-11-23 15:02:31 -5 User: ed Warning: A slightly different error message. --- Date: 2001-11-23 15:03:17 -5 User: ed Fatal: Unknown variable "bar" Stack: - file: TopClass.py line: 23 code: | x = MoreObject("345\n") - file: MoreClass.py line: 58 code: |- foo = bar |
| S3PD - Spec Example 8.18. Implicit Block Mapping Entries | |||||
| Tags: empty-key, mapping, spec View source |
plain key: in-line value : # Both empty "quoted key": - entry |
$doc1 = { "" => undef, "plain key" => "in-line value", "quoted key" => ["entry"] }
|
Doc 1: {
"" : null,
"plain key" : "in-line value",
"quoted key" : [
"entry"
]
}
|
--- '': null plain key: in-line value quoted key: - entry |
plain key: in-line value : "quoted key": - entry |
| S4JQ - Spec Example 6.28. Non-Specific Tags | |||||
| Tags: spec, tag View source |
# Assuming conventional resolution: - "12" - 12 - ! 12 |
$doc1 = [12, 12, 12] |
Doc 1: [ "12", 12, "12" ] |
--- - '12' - 12 - '12' |
- "12" - 12 - ! 12 |
| S4T7 - Document with footer | |||||
| Tags: footer, mapping View source |
aaa: bbb ... |
$doc1 = { aaa => "bbb" }
|
Doc 1: {
"aaa" : "bbb"
}
|
--- aaa: bbb |
aaa: bbb ... |
| S7BG - Colon followed by comma | |||||
| Tags: scalar View source |
--- - :, |
$doc1 = [":,"] |
Doc 1: [ ":," ] |
--- - :, |
--- - :, |
| S9E8 - Spec Example 5.3. Block Structure Indicators | |||||
| Tags: explicit-key, mapping, sequence, spec View source |
sequence: - one - two mapping: ? sky : blue sea : green |
$doc1 = {
mapping => { sea => "green", sky => "blue" },
sequence => ["one", "two"],
}
|
Doc 1: {
"mapping" : {
"sea" : "green",
"sky" : "blue"
},
"sequence" : [
"one",
"two"
]
}
|
--- mapping: sea: green sky: blue sequence: - one - two |
sequence: - one - two mapping: sky: blue sea: green |
| SBG9 - Flow Sequence in Flow Mapping | |||||
| Tags: complex-key, flow, mapping, sequence View source |
{a: [b, c], [d, e]: f} |
$doc1 = { "['d','e']" => "f", "a" => ["b", "c"] }
|
Doc 1: {
"['d','e']" : "f",
"a" : [
"b",
"c"
]
}
|
--- "['d','e']": f a: - b - c |
{a: [b, c], [d, e]: f} |
| SKE5 - Anchor before zero indented sequence | |||||
| Tags: anchor, indent, sequence View source |
--- seq: &anchor - a - b |
$doc1 = { seq => ["a", "b"] }
|
Doc 1: {
"seq" : [
"a",
"b"
]
}
|
--- seq: - a - b |
--- seq: &anchor - a - b |
| SM9W/00 - Single character streams | |||||
| Tags: View source |
-
|
$doc1 = [undef] |
Doc 1: [ null ] |
--- - null |
- |
| SM9W/01 - Single character streams | |||||
| Tags: View source |
:
|
$doc1 = { "" => undef }
|
Doc 1: {
"" : null
}
|
--- '': null |
: |
| SSW6 - Spec Example 7.7. Single Quoted Characters [1.3] | |||||
| Tags: 1.3-mod, scalar, single, spec View source |
--- 'here''s to "quotes"' |
$doc1 = "here's to \"quotes\"" |
Doc 1: "here's to \"quotes\"" |
--- here's to "quotes" |
--- 'here''s to "quotes"' |
| SYW4 - Spec Example 2.2. Mapping Scalars to Scalars | |||||
| Tags: comment, scalar, spec View source |
hr: 65 # Home runs avg: 0.278 # Batting average rbi: 147 # Runs Batted In |
$doc1 = { avg => 0.278, hr => 65, rbi => 147 }
|
Doc 1: {
"avg" : 0.278,
"hr" : 65,
"rbi" : 147
}
|
--- avg: 0.278 hr: 65 rbi: 147 |
hr: 65 avg: 0.278 rbi: 147 |
| T26H - Spec Example 8.8. Literal Content [1.3] | |||||
| Tags: 1.3-mod, comment, literal, scalar, spec, whitespace View source |
--- | literal text # Comment |
$doc1 = "\n\nliteral\n \n\ntext\n" |
Doc 1: "\n\nliteral\n \n\ntext\n" |
--- | literal text |
--- | literal text |
| T4YY - Spec Example 7.9. Single Quoted Lines [1.3] | |||||
| Tags: 1.3-mod, scalar, single, spec, whitespace View source |
--- ' 1st non-empty 2nd non-empty 3rd non-empty ' |
$doc1 = " 1st non-empty\n2nd non-empty 3rd non-empty " |
Doc 1: " 1st non-empty\n2nd non-empty 3rd non-empty " |
--- |2- 1st non-empty 2nd non-empty 3rd non-empty |
--- ' 1st non-empty 2nd non-empty 3rd non-empty ' |
| T5N4 - Spec Example 8.7. Literal Scalar [1.3] | |||||
| Tags: 1.3-mod, literal, scalar, spec, whitespace View source |
--- | literal text |
$doc1 = "literal\n\ttext\n" |
Doc 1: "literal\n\ttext\n" |
--- "literal\n\ttext\n" |
--- | literal text |
| TE2A - Spec Example 8.16. Block Mappings | |||||
| Tags: mapping, spec View source |
block mapping: key: value |
$doc1 = { "block mapping" => { key => "value" } }
|
Doc 1: {
"block mapping" : {
"key" : "value"
}
}
|
--- block mapping: key: value |
block mapping: key: value |
| TL85 - Spec Example 6.8. Flow Folding | |||||
| Tags: double, scalar, spec, upto-1.2, whitespace View source |
" foo bar baz " |
$doc1 = " foo\nbar\nbaz " |
Doc 1: " foo\nbar\nbaz " |
--- |2- foo bar baz |
" foo\nbar\nbaz " |
| TS54 - Folded Block Scalar | |||||
| Tags: 1.3-err, folded, scalar View source |
> ab cd ef gh |
$doc1 = "ab cd\nef\n\ngh\n" |
Doc 1: "ab cd\nef\n\ngh\n" |
--- | ab cd ef gh |
> ab cd ef gh |
| U3C3 - Spec Example 6.16. “TAG” directive | |||||
| Tags: header, spec, tag View source |
%TAG !yaml! tag:yaml.org,2002: --- !yaml!str "foo" |
$doc1 = "foo" |
Doc 1: "foo" |
--- foo |
--- !!str "foo" |
| U3XV - Node and Mapping Key Anchors | |||||
| Tags: 1.3-err, anchor, comment View source |
--- top1: &node1 &k1 key1: one top2: &node2 # comment key2: two top3: &k3 key3: three top4: &node4 &k4 key4: four top5: &node5 key5: five top6: &val6 six top7: &val7 seven |
$doc1 = {
top1 => { key1 => "one" },
top2 => { key2 => "two" },
top3 => { key3 => "three" },
top4 => { key4 => "four" },
top5 => { key5 => "five" },
top6 => "six",
top7 => "seven",
}
|
Doc 1: {
"top1" : {
"key1" : "one"
},
"top2" : {
"key2" : "two"
},
"top3" : {
"key3" : "three"
},
"top4" : {
"key4" : "four"
},
"top5" : {
"key5" : "five"
},
"top6" : "six",
"top7" : "seven"
}
|
--- top1: key1: one top2: key2: two top3: key3: three top4: key4: four top5: key5: five top6: six top7: seven |
--- top1: &node1 &k1 key1: one top2: &node2 key2: two top3: &k3 key3: three top4: &node4 &k4 key4: four top5: &node5 key5: five top6: &val6 six top7: &val7 seven |
| U9NS - Spec Example 2.8. Play by Play Feed from a Game | |||||
| Tags: header, spec View source |
--- time: 20:03:20 player: Sammy Sosa action: strike (miss) ... --- time: 20:03:47 player: Sammy Sosa action: grand slam ... |
$doc1 = { action => "strike (miss)", player => "Sammy Sosa", time => "20:03:20" }
$doc2 = { action => "grand slam", player => "Sammy Sosa", time => "20:03:47" }
|
Doc 1: {
"action" : "strike (miss)",
"player" : "Sammy Sosa",
"time" : "20:03:20"
}
Doc 2: {
"action" : "grand slam",
"player" : "Sammy Sosa",
"time" : "20:03:47"
}
|
--- action: strike (miss) player: Sammy Sosa time: 20:03:20 --- action: grand slam player: Sammy Sosa time: 20:03:47 |
--- time: 20:03:20 player: Sammy Sosa action: strike (miss) ... --- time: 20:03:47 player: Sammy Sosa action: grand slam ... |
| UDM2 - Plain URL in flow mapping | |||||
| Tags: flow, scalar View source |
- { url: http://example.org } |
$doc1 = [{ url => "http://example.org" }]
|
Doc 1: [
{
"url" : "http://example.org"
}
]
|
--- - url: http://example.org |
- {url: http://example.org} |
| UDR7 - Spec Example 5.4. Flow Collection Indicators | |||||
| Tags: flow, mapping, sequence, spec View source |
sequence: [ one, two, ] mapping: { sky: blue, sea: green } |
$doc1 = {
mapping => { sea => "green", sky => "blue" },
sequence => ["one", "two"],
}
|
Doc 1: {
"mapping" : {
"sea" : "green",
"sky" : "blue"
},
"sequence" : [
"one",
"two"
]
}
|
--- mapping: sea: green sky: blue sequence: - one - two |
sequence: - one - two mapping: {sky: blue, sea: green} |
| UGM3 - Spec Example 2.27. Invoice | |||||
| Tags: alias, literal, mapping, sequence, spec, tag, unknown-tag View source |
--- !<tag:clarkevans.com,2002:invoice> invoice: 34843 date : 2001-01-23 bill-to: &id001 given : Chris family : Dumars address: lines: | 458 Walkman Dr. Suite #292 city : Royal Oak state : MI postal : 48046 ship-to: *id001 product: - sku : BL394D quantity : 4 description : Basketball price : 450.00 - sku : BL4438H quantity : 1 description : Super Hoop price : 2392.00 tax : 251.42 total: 4443.52 comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. |
$doc1 = do {
my $a = {
"bill-to" => {
address => {
city => "Royal Oak",
lines => "458 Walkman Dr.\nSuite #292\n",
postal => 48046,
state => "MI",
},
family => "Dumars",
given => "Chris",
},
"comments" => "Late afternoon is best. Backup contact is Nancy Billsmer \@ 338-4338.",
"date" => "2001-01-23",
"invoice" => 34843,
"product" => [
{ description => "Basketball", price => 450, quantity => 4, sku => "BL394D" },
{ description => "Super Hoop", price => 2392, quantity => 1, sku => "BL4438H" },
],
"ship-to" => 'fix',
"tax" => 251.42,
"total" => 4443.52,
};
$a->{"ship-to"} = $a->{"bill-to"};
$a;
}
|
Doc 1: {
"bill-to" : {
"address" : {
"city" : "Royal Oak",
"lines" : "458 Walkman Dr.\nSuite #292\n",
"postal" : 48046,
"state" : "MI"
},
"family" : "Dumars",
"given" : "Chris"
},
"comments" : "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.",
"date" : "2001-01-23",
"invoice" : 34843,
"product" : [
{
"description" : "Basketball",
"price" : 450,
"quantity" : 4,
"sku" : "BL394D"
},
{
"description" : "Super Hoop",
"price" : 2392,
"quantity" : 1,
"sku" : "BL4438H"
}
],
"ship-to" : {
"address" : {
"city" : "Royal Oak",
"lines" : "458 Walkman Dr.\nSuite #292\n",
"postal" : 48046,
"state" : "MI"
},
"family" : "Dumars",
"given" : "Chris"
},
"tax" : 251.42,
"total" : 4443.52
}
|
--- bill-to: &1 address: city: Royal Oak lines: | 458 Walkman Dr. Suite #292 postal: 48046 state: MI family: Dumars given: Chris comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. date: 2001-01-23 invoice: 34843 product: - description: Basketball price: 450.0 quantity: 4 sku: BL394D - description: Super Hoop price: 2392.0 quantity: 1 sku: BL4438H ship-to: *1 tax: 251.42 total: 4443.52 |
--- !<tag:clarkevans.com,2002:invoice> invoice: 34843 date: 2001-01-23 bill-to: &id001 given: Chris family: Dumars address: lines: | 458 Walkman Dr. Suite #292 city: Royal Oak state: MI postal: 48046 ship-to: *id001 product: - sku: BL394D quantity: 4 description: Basketball price: 450.00 - sku: BL4438H quantity: 1 description: Super Hoop price: 2392.00 tax: 251.42 total: 4443.52 comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. |
| UKK6/00 - Syntax character edge cases | |||||
| Tags: View source |
- : |
$doc1 = [{ "" => undef }]
|
Doc 1: [
{
"" : null
}
]
|
--- - '': null |
- : |
| UKK6/01 - Syntax character edge cases | |||||
| Tags: View source |
::
Line : 1 Column : 1 Message : Invalid plain scalar Where : YAML/PP/Lexer.pm line 378 YAML : "::" at YAML/PP/Loader.pm line 94. |
||||
| UKK6/02 - Syntax character edge cases | |||||
| Tags: View source |
! |
$doc1 = "" |
Doc 1: "" |
--- '' |
! |
| UT92 - Spec Example 9.4. Explicit Documents | |||||
| Tags: comment, flow, footer, header, spec View source |
--- { matches % : 20 } ... --- # Empty ... |
$doc1 = { "matches %" => 20 }
$doc2 = undef
|
Doc 1: {
"matches %" : 20
}
Doc 2: null
|
--- matches %: 20 --- null |
--- {matches %: 20} ... --- ... |
| UV7Q - Legal tab after indentation | |||||
| Tags: indent, whitespace View source |
x: - x x |
$doc1 = { x => ["x x"] }
|
Doc 1: {
"x" : [
"x x"
]
}
|
--- x: - x x |
x: - x x |
| V55R - Aliases in Block Sequence | |||||
| Tags: alias, sequence View source |
- &a a - &b b - *a - *b |
$doc1 = ["a", "b", "a", "b"] |
Doc 1: [ "a", "b", "a", "b" ] |
--- - a - b - a - b |
- &a a - &b b - *a - *b |
| V9D5 - Spec Example 8.19. Compact Block Mappings | |||||
| Tags: complex-key, explicit-key, mapping, spec View source |
- sun: yellow - ? earth: blue : moon: white |
$doc1 = [
{ sun => "yellow" },
{ "{earth => 'blue'}" => { moon => "white" } },
]
|
Doc 1: [
{
"sun" : "yellow"
},
{
"{earth => 'blue'}" : {
"moon" : "white"
}
}
]
|
--- - sun: yellow - "{earth => 'blue'}": moon: white |
- sun: yellow - ? earth: blue : moon: white |
| VJP3/01 - Flow collections over many lines | |||||
| Tags: View source |
k: { k : v } |
$doc1 = { k => { k => "v" } }
|
Doc 1: {
"k" : {
"k" : "v"
}
}
|
--- k: k: v |
k: {k: v} |
| W42U - Spec Example 8.15. Block Sequence Entry Types | |||||
| Tags: comment, literal, sequence, spec View source |
- # Empty - | block node - - one # Compact - two # sequence - one: two # Compact mapping |
$doc1 = [undef, "block node\n", ["one", "two"], { one => "two" }]
|
Doc 1: [
null,
"block node\n",
[
"one",
"two"
],
{
"one" : "two"
}
]
|
--- - null - | block node - - one - two - one: two |
- - | block node - - one - two - one: two |
| W4TN - Spec Example 9.5. Directives Documents | |||||
| Tags: 1.3-err, footer, header, spec View source |
%YAML 1.2 --- | %!PS-Adobe-2.0 ... %YAML 1.2 --- # Empty ... |
$doc1 = "%!PS-Adobe-2.0\n" $doc2 = undef |
Doc 1: "%!PS-Adobe-2.0\n" Doc 2: null |
--- | %!PS-Adobe-2.0 --- null |
%YAML 1.2 --- | %!PS-Adobe-2.0 ... %YAML 1.2 --- ... |
| W5VH - Allowed characters in alias | |||||
| Tags: 1.3-err, alias View source |
a: &:@*!$"<foo>: scalar a b: *:@*!$"<foo>: |
$doc1 = { a => "scalar a", b => "scalar a" }
|
Doc 1: {
"a" : "scalar a",
"b" : "scalar a"
}
|
--- a: scalar a b: scalar a |
a: &:@*!$"<foo>: scalar a b: *:@*!$"<foo>: |
| WZ62 - Spec Example 7.2. Empty Content | |||||
| Tags: flow, scalar, spec, tag View source |
{ foo : !!str, !!str : bar, } |
$doc1 = { "" => "bar", "foo" => "" }
|
Doc 1: {
"" : "bar",
"foo" : ""
}
|
--- '': bar foo: '' |
{foo: !!str , !!str : bar} |
| X38W - Aliases in Flow Objects | |||||
| Tags: alias, complex-key, flow View source |
{ &a [a, &b b]: *b, *a : [c, *b, d]} Duplicate key '['a','b']' at YAML/PP/Parser.pm line 61. at YAML/PP/Loader.pm line 94. |
{ &a [a, &b b] : *b , *a : [c , *b, d]} |
|||
| X8DW - Explicit key and value seperated by comment | |||||
| Tags: comment, explicit-key, mapping View source |
--- ? key # comment : value |
$doc1 = { key => "value" }
|
Doc 1: {
"key" : "value"
}
|
--- key: value |
--- key: value |
| XLQ9 - Multiline scalar that looks like a YAML directive | |||||
| Tags: directive, scalar View source |
--- scalar %YAML 1.2 |
$doc1 = "scalar %YAML 1.2" |
Doc 1: "scalar %YAML 1.2" |
--- scalar %YAML 1.2 |
--- scalar %YAML 1.2 |
| XV9V - Spec Example 6.5. Empty Lines [1.3] | |||||
| Tags: 1.3-mod, literal, scalar, spec View source |
Folding: "Empty line as a line feed" Chomping: | Clipped empty lines |
$doc1 = {
Chomping => "Clipped empty lines\n",
Folding => "Empty line\nas a line feed",
}
|
Doc 1: {
"Chomping" : "Clipped empty lines\n",
"Folding" : "Empty line\nas a line feed"
}
|
--- Chomping: | Clipped empty lines Folding: |- Empty line as a line feed |
Folding: "Empty line\nas a line feed" Chomping: | Clipped empty lines |
| XW4D - Various Trailing Comments | |||||
| Tags: 1.3-err, comment, explicit-key, folded View source |
a: "double quotes" # lala b: plain value # lala c : #lala d ? # lala - seq1 : # lala - #lala seq2 e: &node # lala - x: y block: > # lala abcde |
$doc1 = {
"['seq1']" => ["seq2"],
"a" => "double quotes",
"b" => "plain value",
"block" => "abcde\n",
"c" => "d",
"e" => [{ x => "y" }],
}
|
Doc 1: {
"['seq1']" : [
"seq2"
],
"a" : "double quotes",
"b" : "plain value",
"block" : "abcde\n",
"c" : "d",
"e" : [
{
"x" : "y"
}
]
}
|
--- "['seq1']": - seq2 a: double quotes b: plain value block: | abcde c: d e: - x: y |
a: "double quotes" b: plain value c: d ? - seq1 : - seq2 e: &node - x: y block: > abcde |
| Y2GN - Anchor with colon in the middle | |||||
| Tags: anchor View source |
--- key: &an:chor value |
$doc1 = { key => "value" }
|
Doc 1: {
"key" : "value"
}
|
--- key: value |
--- key: &an:chor value |
| Y79Y/001 - Tabs in various contexts | |||||
| Tags: View source |
foo: | bar: 1 |
$doc1 = { bar => 1, foo => "\t\n" }
|
Doc 1: {
"bar" : 1,
"foo" : "\t\n"
}
|
--- bar: 1 foo: "\t\n" |
foo: | bar: 1 |
| Y79Y/002 - Tabs in various contexts | |||||
| Tags: View source |
- [ foo ] |
$doc1 = [["foo"]] |
Doc 1: [
[
"foo"
]
]
|
--- - - foo |
- - foo |
| Y79Y/010 - Tabs in various contexts | |||||
| Tags: View source |
- -1 |
$doc1 = [-1] |
Doc 1: [ -1 ] |
--- - -1 |
- -1 |
| YD5X - Spec Example 2.5. Sequence of Sequences | |||||
| Tags: sequence, spec View source |
- [name , hr, avg ] - [Mark McGwire, 65, 0.278] - [Sammy Sosa , 63, 0.288] |
$doc1 = [ ["name", "hr", "avg"], ["Mark McGwire", 65, 0.278], ["Sammy Sosa", 63, 0.288], ] |
Doc 1: [
[
"name",
"hr",
"avg"
],
[
"Mark McGwire",
65,
0.278
],
[
"Sammy Sosa",
63,
0.288
]
]
|
--- - - name - hr - avg - - Mark McGwire - 65 - 0.278 - - Sammy Sosa - 63 - 0.288 |
- - name - hr - avg - - Mark McGwire - 65 - 0.278 - - Sammy Sosa - 63 - 0.288 |
| Z67P - Spec Example 8.21. Block Scalar Nodes [1.3] | |||||
| Tags: 1.3-mod, folded, indent, literal, local-tag, spec, tag View source |
literal: |2 value folded: !foo >1 value |
$doc1 = { folded => "value\n", literal => "value\n" }
|
Doc 1: {
"folded" : "value\n",
"literal" : "value\n"
}
|
--- folded: | value literal: | value |
literal: | value folded: !foo > value |
| Z9M4 - Spec Example 6.22. Global Tag Prefix | |||||
| Tags: header, spec, tag, unknown-tag View source |
%TAG !e! tag:example.com,2000:app/ --- - !e!foo "bar" |
$doc1 = ["bar"] |
Doc 1: [ "bar" ] |
--- - bar |
--- - !<tag:example.com,2000:app/foo> "bar" |
| ZF4X - Spec Example 2.6. Mapping of Mappings | |||||
| Tags: flow, mapping, spec View source |
Mark McGwire: {hr: 65, avg: 0.278} Sammy Sosa: { hr: 63, avg: 0.288 } |
$doc1 = {
"Mark McGwire" => { avg => 0.278, hr => 65 },
"Sammy Sosa" => { avg => 0.288, hr => 63 },
}
|
Doc 1: {
"Mark McGwire" : {
"avg" : 0.278,
"hr" : 65
},
"Sammy Sosa" : {
"avg" : 0.288,
"hr" : 63
}
}
|
--- Mark McGwire: avg: 0.278 hr: 65 Sammy Sosa: avg: 0.288 hr: 63 |
Mark McGwire: {hr: 65, avg: 0.278} Sammy Sosa: {hr: 63, avg: 0.288} |
| ZH7C - Anchors in Mapping | |||||
| Tags: anchor, mapping View source |
&a a: b c: &d d |
$doc1 = { a => "b", c => "d" }
|
Doc 1: {
"a" : "b",
"c" : "d"
}
|
--- a: b c: d |
&a a: b c: &d d |
| ZK9H - Nested top level flow mapping | |||||
| Tags: flow, indent, mapping, sequence View source |
{ key: [[[ value ]]] } |
$doc1 = { key => [[["value"]]] }
|
Doc 1: {
"key" : [
[
[
"value"
]
]
]
}
|
--- key: - - - value |
{key: [[ [value]]]} |
| ZWK4 - Key with anchor after missing explicit mapping value | |||||
| Tags: anchor, explicit-key, mapping View source |
--- a: 1 ? b &anchor c: 3 |
$doc1 = { a => 1, b => undef, c => 3 }
|
Doc 1: {
"a" : 1,
"b" : null,
"c" : 3
}
|
--- a: 1 b: null c: 3 |
--- a: 1 b: &anchor c: 3 |
| YAML::PP::Highlight | YAML::PP::Loader | Data::Dump | YAML::PP::Loader | JSON::XS | YAML::PP::Loader | YAML::PP::Dumper | YAML::PP::Parser | YAML::PP::Emitter | |
| 236B - Invalid value after mapping | |||||
| Tags: error, mapping View source |
foo: bar invalid Line : 3 Column : 8 Expected : COLON WS Got : EOL Where : YAML/PP/Parser.pm line 392 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| 2CMS - Invalid mapping in plain multiline | |||||
| Tags: error, mapping View source |
this is invalid: x Line : 3 Column : 10 Expected : EOL Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ": x\n" at YAML/PP/Loader.pm line 94. |
||||
| 2G84/00 - Literal modifers | |||||
| Tags: View source |
--- |0 Line : 1 Column : 6 Message : Invalid block scalar Where : YAML/PP/Lexer.pm line 556 YAML : 0 at YAML/PP/Loader.pm line 94. |
||||
| 2G84/01 - Literal modifers | |||||
| Tags: View source |
--- |10 Line : 1 Column : 7 Message : Invalid block scalar Where : YAML/PP/Lexer.pm line 556 YAML : 0 at YAML/PP/Loader.pm line 94. |
||||
| 3HFZ - Invalid content after document end marker | |||||
| Tags: error, footer View source |
--- key: value ... invalid Line : 3 Column : 4 Expected : EOL Got : WS Where : YAML/PP/Parser.pm line 392 YAML : " invalid\n" at YAML/PP/Loader.pm line 94. |
||||
| 4EJS - Invalid tabs as indendation in a mapping | |||||
| Tags: error, mapping, whitespace View source |
--- a: b: c: value Line : 3 Column : 1 Expected : ALIAS COLON DOC_END DOC_START EOL PLAIN QUESTION QUOTED Got : WS Where : YAML/PP/Parser.pm line 392 YAML : "\tb:\n" at YAML/PP/Loader.pm line 94. |
||||
| 4H7K - Flow sequence with invalid extra closing bracket | |||||
| Tags: error, flow, sequence View source |
--- [ a, b, c ] ] Line : 2 Column : 12 Expected : EOL Got : WS Where : YAML/PP/Parser.pm line 392 YAML : " ]" at YAML/PP/Loader.pm line 94. |
||||
| 4HVU - Wrong indendation in Sequence | |||||
| Tags: error, indent, sequence View source |
key: - ok - also ok - wrong Line : 4 Column : 3 Message : Expected MAP Where : YAML/PP/Parser.pm line 239 YAML : "- wrong\n" at YAML/PP/Loader.pm line 94. |
||||
| 4JVG - Scalar value with two anchors | |||||
| Tags: anchor, error, mapping View source |
top1: &node1 &k1 key1: val1 top2: &node2 &v2 val2 Line : 4 Column : 1 Message : A node can only have one anchor Where : YAML/PP/Parser.pm line 704 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| 55WF - Invalid escape in double quoted string | |||||
| Tags: double, error View source |
--- "\." Line : 2 Column : 2 Message : Invalid quoted <"> string Where : YAML/PP/Lexer.pm line 754 YAML : "\\.\"" at YAML/PP/Loader.pm line 94. |
||||
| 5LLU - Block scalar with wrong indented line after spaces only | |||||
| Tags: error, folded, whitespace View source |
block scalar: > invalid Line : 5 Column : 2 Message : Bad indendation in MAP Where : YAML/PP/Parser.pm line 204 YAML : "invalid\n" at YAML/PP/Loader.pm line 94. |
||||
| 5TRB - Invalid document-start marker in doublequoted tring | |||||
| Tags: double, error, header View source |
--- " --- " Line : 3 Column : 1 Message : Missing closing quote <"> or invalid document marker Where : YAML/PP/Lexer.pm line 661 YAML : "---" at YAML/PP/Loader.pm line 94. |
||||
| 5U3A - Sequence on same Line as Mapping Key | |||||
| Tags: error, mapping, sequence View source |
key: - a - b Line : 1 Column : 6 Expected : ALIAS BLOCK_SCALAR DOC_END FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUOTED QUOTED_MULTILINE Got : DASH Where : YAML/PP/Parser.pm line 392 YAML : "- a\n" at YAML/PP/Loader.pm line 94. |
||||
| 62EZ - Invalid block mapping key on same line as previous key | |||||
| Tags: error, flow, mapping View source |
--- x: { y: z }in: valid Line : 2 Column : 12 Expected : EOL Got : PLAIN Where : YAML/PP/Parser.pm line 392 YAML : "in: valid\n" at YAML/PP/Loader.pm line 94. |
||||
| 6JTT - Flow sequence without closing bracket | |||||
| Tags: error, flow, sequence View source |
--- [ [ a, b, c ] Unexpected end of flow context at YAML/PP/Parser.pm line 634. at YAML/PP/Loader.pm line 94. |
||||
| 6S55 - Invalid scalar at the end of sequence | |||||
| Tags: error, mapping, sequence View source |
key: - bar - baz invalid Line : 4 Column : 2 Expected : DASH DOC_END DOC_START EOL Got : PLAIN Where : YAML/PP/Parser.pm line 392 YAML : "invalid" at YAML/PP/Loader.pm line 94. |
||||
| 7LBH - Multiline double quoted implicit keys | |||||
| Tags: double, error View source |
"a\nb": 1 "c d": 1 Line : 2 Column : 1 Expected : ALIAS COLON DOC_END DOC_START EOL PLAIN QUESTION QUOTED Got : QUOTED_MULTILINE Where : YAML/PP/Parser.pm line 392 YAML : "c d: 1\n" at YAML/PP/Loader.pm line 94. |
||||
| 7MNF - Missing colon | |||||
| Tags: error, mapping View source |
top1: key1: val1 top2 Line : 3 Column : 5 Expected : COLON WS Got : EOL Where : YAML/PP/Parser.pm line 392 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| 8XDJ - Comment in plain multiline value | |||||
| Tags: comment, error, scalar View source |
key: word1 # xxx word2 Line : 3 Column : 3 Message : Bad indendation in MAP Where : YAML/PP/Parser.pm line 204 YAML : "word2\n" at YAML/PP/Loader.pm line 94. |
||||
| 9C9N - Wrong indented flow sequence | |||||
| Tags: error, flow, indent, sequence View source |
--- flow: [a, b, c] Line : 3 Column : 1 Message : Bad indendation in FLOWSEQ Where : YAML/PP/Parser.pm line 199 YAML : "b,\n" at YAML/PP/Loader.pm line 94. |
||||
| 9CWY - Invalid scalar at the end of mapping | |||||
| Tags: error, mapping, sequence View source |
key: - item1 - item2 invalid Line : 4 Column : 8 Expected : COLON WS Got : EOL Where : YAML/PP/Parser.pm line 392 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| 9HCY - Need document footer before directives | |||||
| Tags: directive, error, footer, tag, unknown-tag View source |
!foo "bar" %TAG ! tag:example.com,2000:app/ --- !foo "bar" Line : 2 Column : 1 Expected : DOC_END DOC_START EOL Got : TAG_DIRECTIVE Where : YAML/PP/Parser.pm line 392 YAML : "%TAG ! tag:example.com,2000:app/" at YAML/PP/Loader.pm line 94. |
||||
| 9JBA - Invalid comment after end of flow sequence | |||||
| Tags: comment, error, flow, sequence View source |
--- [ a, b, c, ]#invalid Line : 2 Column : 13 Message : Invalid plain scalar Where : YAML/PP/Lexer.pm line 378 YAML : "#invalid" at YAML/PP/Loader.pm line 94. |
||||
| 9KBC - Mapping starting at --- line | |||||
| Tags: error, header, mapping View source |
--- key1: value1 key2: value2 |
$doc1 = { key1 => "value1", key2 => "value2" }
|
Doc 1: {
"key1" : "value1",
"key2" : "value2"
}
|
--- key1: value1 key2: value2 |
--- key1: value1 key2: value2 |
| 9MAG - Flow sequence with invalid comma at the beginning | |||||
| Tags: error, flow, sequence View source |
--- [ , a, b, c ] Line : 2 Column : 3 Expected : ALIAS COLON FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUOTED QUOTED_MULTILINE Got : FLOW_COMMA Where : YAML/PP/Parser.pm line 392 YAML : ", a, b, c ]\n" at YAML/PP/Loader.pm line 94. |
||||
| 9MMA - Directive by itself with no document | |||||
| Tags: directive, error View source |
%YAML 1.2 Line : 1 Column : 1 Message : Directive needs document start Where : YAML/PP/Parser.pm line 424 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| 9MQT/01 - Scalar doc with '...' in content | |||||
| Tags: View source |
--- "a ... x b" Line : 2 Column : 1 Message : Missing closing quote <"> or invalid document marker Where : YAML/PP/Lexer.pm line 661 YAML : "... x" at YAML/PP/Loader.pm line 94. |
||||
| B63P - Directive without document | |||||
| Tags: directive, document, error View source |
%YAML 1.2 ... Line : 2 Column : 1 Expected : DOC_START EOL RESERVED_DIRECTIVE TAG_DIRECTIVE YAML_DIRECTIVE Got : DOC_END Where : YAML/PP/Parser.pm line 392 YAML : "..." at YAML/PP/Loader.pm line 94. |
||||
| BD7L - Invalid mapping after sequence | |||||
| Tags: error, mapping, sequence View source |
- item1 - item2 invalid: x Line : 3 Column : 1 Expected : DASH DOC_END DOC_START EOL Got : PLAIN Where : YAML/PP/Parser.pm line 392 YAML : "invalid: x\n" at YAML/PP/Loader.pm line 94. |
||||
| BF9H - Trailing comment in multiline plain scalar | |||||
| Tags: comment, error, scalar View source |
--- plain: a b # end of scalar c Line : 4 Column : 8 Message : Bad indendation in MAP Where : YAML/PP/Parser.pm line 204 YAML : "c\n" at YAML/PP/Loader.pm line 94. |
||||
| BS4K - Comment between plain scalar lines | |||||
| Tags: error, scalar View source |
word1 # comment word2 Line : 2 Column : 1 Expected : DOC_END DOC_START EOL Got : PLAIN Where : YAML/PP/Parser.pm line 392 YAML : "word2" at YAML/PP/Loader.pm line 94. |
||||
| C2SP - Flow Mapping Key on two lines | |||||
| Tags: error, flow, mapping View source |
[23 ]: 42 Line : 2 Column : 2 Expected : EOL Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ": 42\n" at YAML/PP/Loader.pm line 94. |
||||
| CML9 - Missing comma in flow | |||||
| Tags: comment, error, flow View source |
key: [ word1 # xxx word2 ] Line : 3 Column : 3 Expected : EOL FLOWSEQ_END FLOW_COMMA WS Got : PLAIN Where : YAML/PP/Parser.pm line 392 YAML : "word2 ]" at YAML/PP/Loader.pm line 94. |
||||
| CQ3W - Double quoted string without closing quote | |||||
| Tags: double, error View source |
--- key: "missing closing quote Line : 2 Column : 1 Message : Missing closing quote <"> at EOF Where : YAML/PP/Lexer.pm line 641 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| CTN5 - Flow sequence with invalid extra comma | |||||
| Tags: error, flow, sequence View source |
--- [ a, b, c, , ] Line : 2 Column : 12 Expected : ALIAS COLON FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUOTED QUOTED_MULTILINE Got : FLOW_COMMA Where : YAML/PP/Parser.pm line 392 YAML : ", ]" at YAML/PP/Loader.pm line 94. |
||||
| CVW2 - Invalid comment after comma | |||||
| Tags: comment, error, flow, sequence View source |
--- [ a, b, c,#invalid ] Line : 2 Column : 11 Message : Invalid plain scalar Where : YAML/PP/Lexer.pm line 378 YAML : "#invalid" at YAML/PP/Loader.pm line 94. |
||||
| CXX2 - Mapping with anchor on document start line | |||||
| Tags: anchor, error, header, mapping View source |
--- &anchor a: b |
$doc1 = { a => "b" }
|
Doc 1: {
"a" : "b"
}
|
--- a: b |
--- &anchor a: b |
| D49Q - Multiline single quoted implicit keys | |||||
| Tags: error, mapping, single View source |
'a\nb': 1 'c d': 1 Line : 2 Column : 1 Expected : ALIAS COLON DOC_END DOC_START EOL PLAIN QUESTION QUOTED Got : QUOTED_MULTILINE Where : YAML/PP/Parser.pm line 392 YAML : "c d: 1\n" at YAML/PP/Loader.pm line 94. |
||||
| DK4H - Implicit key followed by newline | |||||
| Tags: error, flow, mapping, sequence View source |
--- [ key : value ] Line : 3 Column : 3 Expected : EOL FLOWSEQ_END FLOW_COMMA WS Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ": value ]\n" at YAML/PP/Loader.pm line 94. |
||||
| DK95/01 - Tabs that look like indentation | |||||
| Tags: View source |
foo: "bar baz" Line : 2 Column : 1 Message : Wrong indendation or missing closing quote <"> Where : YAML/PP/Lexer.pm line 671 YAML : "\tbaz\"" at YAML/PP/Loader.pm line 94. |
||||
| DK95/06 - Tabs that look like indentation | |||||
| Tags: View source |
foo: a: 1 b: 2 Line : 3 Column : 3 Expected : ALIAS COLON DOC_END DOC_START EOL PLAIN QUESTION QUOTED Got : WS Where : YAML/PP/Parser.pm line 392 YAML : "\tb: 2\n" at YAML/PP/Loader.pm line 94. |
||||
| DMG6 - Wrong indendation in Map | |||||
| Tags: error, indent, mapping View source |
key: ok: 1 wrong: 2 Line : 3 Column : 2 Message : Expected MAP Where : YAML/PP/Parser.pm line 239 YAML : "wrong: 2\n" at YAML/PP/Loader.pm line 94. |
||||
| EB22 - Missing document-end marker before directive | |||||
| Tags: directive, error, footer View source |
--- scalar1 # comment %YAML 1.2 --- scalar2 Line : 3 Column : 1 Expected : DOC_END DOC_START EOL Got : YAML_DIRECTIVE Where : YAML/PP/Parser.pm line 392 YAML : "%YAML 1.2" at YAML/PP/Loader.pm line 94. |
||||
| EW3V - Wrong indendation in mapping | |||||
| Tags: error, indent, mapping View source |
k1: v1 k2: v2 Line : 2 Column : 4 Expected : EOL Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ": v2\n" at YAML/PP/Loader.pm line 94. |
||||
| G5U8 - Plain dashes in flow sequence | |||||
| Tags: flow, sequence View source |
--- - [-, -] Line : 2 Column : 4 Message : Invalid plain scalar Where : YAML/PP/Lexer.pm line 378 YAML : "-, -]" at YAML/PP/Loader.pm line 94. |
||||
| G7JE - Multiline implicit keys | |||||
| Tags: error, mapping View source |
a\nb: 1 c d: 1 Line : 2 Column : 1 Expected : ALIAS COLON DOC_END DOC_START EOL PLAIN QUESTION QUOTED Got : PLAIN_MULTI Where : YAML/PP/Parser.pm line 392 YAML : "c d: 1\n" at YAML/PP/Loader.pm line 94. |
||||
| G9HC - Invalid anchor in zero indented sequence | |||||
| Tags: anchor, error, sequence View source |
--- seq: &anchor - a - b Line : 3 Column : 8 Expected : WS Got : EOL Where : YAML/PP/Parser.pm line 392 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| GDY7 - Comment that looks like a mapping key | |||||
| Tags: comment, error, mapping View source |
key: value this is #not a: key Line : 2 Column : 8 Expected : COLON WS Got : EOL Where : YAML/PP/Parser.pm line 392 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| GT5M - Node anchor in sequence | |||||
| Tags: anchor, error, sequence View source |
- item1 &node - item2 Line : 2 Column : 1 Expected : DASH DOC_END DOC_START EOL Got : ANCHOR Where : YAML/PP/Parser.pm line 392 YAML : "&node" at YAML/PP/Loader.pm line 94. |
||||
| H7J7 - Node anchor not indented | |||||
| Tags: anchor, error, indent, tag View source |
key: &x !!map a: b Line : 2 Column : 6 Expected : WS Got : EOL Where : YAML/PP/Parser.pm line 392 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| H7TQ - Extra words on %YAML directive | |||||
| Tags: directive View source |
%YAML 1.2 foo --- Line : 1 Column : 10 Expected : EOL WS Got : Invalid directive Where : YAML/PP/Parser.pm line 392 YAML : " foo" at YAML/PP/Loader.pm line 94. |
||||
| HRE5 - Double quoted scalar with escaped single quote | |||||
| Tags: double, error, single View source |
--- double: "quoted \' scalar" Line : 2 Column : 17 Message : Invalid quoted <"> string Where : YAML/PP/Lexer.pm line 754 YAML : "\\' scalar\"" at YAML/PP/Loader.pm line 94. |
||||
| HU3P - Invalid Mapping in plain scalar | |||||
| Tags: error, mapping, scalar View source |
key: word1 word2 no: key Line : 3 Column : 5 Expected : EOL Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ": key\n" at YAML/PP/Loader.pm line 94. |
||||
| JKF3 - Multiline unidented double quoted block key | |||||
| Tags: indent View source |
- - "bar bar": x Line : 2 Column : 1 Message : Wrong indendation or missing closing quote <"> Where : YAML/PP/Lexer.pm line 671 YAML : "bar\": x" at YAML/PP/Loader.pm line 94. |
||||
| JY7Z - Trailing content that looks like a mapping | |||||
| Tags: double, error, mapping View source |
key1: "quoted1" key2: "quoted2" no key: nor value key3: "quoted3" Line : 2 Column : 16 Expected : EOL Got : WS Where : YAML/PP/Parser.pm line 392 YAML : " no key: nor value\n" at YAML/PP/Loader.pm line 94. |
||||
| KS4U - Invalid item after end of flow sequence | |||||
| Tags: error, flow, sequence View source |
--- [ sequence item ] invalid item Line : 5 Column : 1 Expected : DOC_END DOC_START EOL Got : PLAIN Where : YAML/PP/Parser.pm line 392 YAML : "invalid item" at YAML/PP/Loader.pm line 94. |
||||
| LHL4 - Invalid tag | |||||
| Tags: error, tag View source |
--- !invalid{}tag scalar Line : 2
Column : 9
Expected : EOL WS
Got : FLOWMAP_START
Where : YAML/PP/Parser.pm line 392
YAML : "{}tag scalar\n"
at YAML/PP/Loader.pm line 94.
|
||||
| MUS6/00 - Directive variants | |||||
| Tags: View source |
%YAML 1.1#... --- Line : 1 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 : Invalid directive Where : YAML/PP/Parser.pm line 392 YAML : "%YAML 1.1#...\n" at YAML/PP/Loader.pm line 94. |
||||
| MUS6/01 - Directive variants | |||||
| Tags: View source |
%YAML 1.2 --- %YAML 1.2 --- 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 : YAML/PP/Parser.pm line 392 YAML : "%YAML 1.2" at YAML/PP/Loader.pm line 94. |
||||
| N4JP - Bad indentation in mapping | |||||
| Tags: double, error, indent, mapping View source |
map: key1: "quoted1" key2: "bad indentation" Line : 3 Column : 2 Message : Expected MAP Where : YAML/PP/Parser.pm line 239 YAML : "key2: \"bad indentation\"\n" at YAML/PP/Loader.pm line 94. |
||||
| N782 - Invalid document markers in flow style | |||||
| Tags: edge, error, flow, footer, header View source |
[ --- , ... ] Line : 2 Column : 1 Expected : ALIAS COLON FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUOTED QUOTED_MULTILINE Got : DOC_START Where : YAML/PP/Parser.pm line 392 YAML : "--- ," at YAML/PP/Loader.pm line 94. |
||||
| P2EQ - Invalid sequene item on same line as previous item | |||||
| Tags: error, flow, mapping, sequence View source |
--- - { y: z }- invalid Line : 2 Column : 11 Expected : EOL Got : DASH Where : YAML/PP/Parser.pm line 392 YAML : "- invalid\n" at YAML/PP/Loader.pm line 94. |
||||
| Q4CL - Trailing content after quoted value | |||||
| Tags: double, error, mapping View source |
key1: "quoted1" key2: "quoted2" trailing content key3: "quoted3" Line : 2 Column : 16 Expected : EOL Got : WS Where : YAML/PP/Parser.pm line 392 YAML : " trailing content\n" at YAML/PP/Loader.pm line 94. |
||||
| QB6E - Wrong indented multiline quoted scalar | |||||
| Tags: double, error, indent View source |
--- quoted: "a b c" Line : 3 Column : 1 Message : Wrong indendation or missing closing quote <"> Where : YAML/PP/Lexer.pm line 671 YAML : "b" at YAML/PP/Loader.pm line 94. |
||||
| QLJ7 - Tag shorthand used in documents but only defined in the first | |||||
| Tags: directive, error, tag View source |
%TAG !prefix! tag:example.com,2011: --- !prefix!A a: b --- !prefix!B c: d --- !prefix!C e: f Found undefined tag handle '!prefix!' at YAML/PP/Parser.pm line 994. at YAML/PP/Loader.pm line 94. |
||||
| RHX7 - YAML directive without document end marker | |||||
| Tags: directive, error View source |
--- key: value %YAML 1.2 --- Line : 3 Column : 1 Expected : ALIAS COLON DOC_END DOC_START EOL PLAIN QUESTION QUOTED Got : YAML_DIRECTIVE Where : YAML/PP/Parser.pm line 392 YAML : "%YAML 1.2" at YAML/PP/Loader.pm line 94. |
||||
| RXY3 - Invalid document-end marker in single quoted string | |||||
| Tags: error, footer, single View source |
--- ' ... ' Line : 3 Column : 1 Message : Missing closing quote <'> or invalid document marker Where : YAML/PP/Lexer.pm line 661 YAML : "..." at YAML/PP/Loader.pm line 94. |
||||
| S4GJ - Invalid text after block scalar indicator | |||||
| Tags: error, folded View source |
--- folded: > first line second line Line : 2 Column : 10 Message : Invalid block scalar Where : YAML/PP/Lexer.pm line 556 YAML : " first line" at YAML/PP/Loader.pm line 94. |
||||
| S98Z - Block scalar with more spaces than first content line | |||||
| Tags: comment, error, folded, scalar, whitespace View source |
empty block scalar: > # comment |
$doc1 = { "empty block scalar" => "" }
|
Doc 1: {
"empty block scalar" : ""
}
|
--- empty block scalar: '' |
empty block scalar: "" |
| SF5V - Duplicate YAML directive | |||||
| Tags: directive, error View source |
%YAML 1.2 %YAML 1.2 --- Found duplicate YAML directive at YAML/PP/Loader.pm line 94. at YAML/PP/Loader.pm line 94. |
||||
| SR86 - Anchor plus Alias | |||||
| Tags: alias, error View source |
key1: &a value key2: &b *a Line : 2 Column : 12 Message : Parse error: Alias not allowed in this context Where : YAML/PP/Parser.pm line 731 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| SU5Z - Comment without whitespace after doublequoted scalar | |||||
| Tags: comment, double, error, whitespace View source |
key: "value"# invalid comment Line : 1 Column : 13 Message : Invalid plain scalar Where : YAML/PP/Lexer.pm line 378 YAML : "# invalid comment" at YAML/PP/Loader.pm line 94. |
||||
| SU74 - Anchor and alias as mapping key | |||||
| Tags: alias, anchor, error, mapping View source |
key1: &alias value1 &b *alias : value2 Line : 2 Column : 10 Message : Parse error: Alias not allowed in this context Where : YAML/PP/Parser.pm line 731 YAML : " : value2\n" at YAML/PP/Loader.pm line 94. |
||||
| SY6V - Anchor before sequence entry on same line | |||||
| Tags: anchor, error, sequence View source |
&anchor - sequence entry Line : 1 Column : 9 Expected : ALIAS BLOCK_SCALAR COLON DOC_END DOC_START EOL FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUESTION QUOTED QUOTED_MULTILINE WS Got : DASH Where : YAML/PP/Parser.pm line 392 YAML : "- sequence entry\n" at YAML/PP/Loader.pm line 94. |
||||
| T833 - Flow mapping missing a separating comma | |||||
| Tags: error, flow, mapping View source |
--- { foo: 1 bar: 2 } |
$doc1 = { "" => 2, "foo" => "1 bar" }
|
Doc 1: {
"" : 2,
"foo" : "1 bar"
}
|
--- '': 2 foo: 1 bar |
--- {foo: 1 bar, : 2} |
| TD5N - Invalid scalar after sequence | |||||
| Tags: error, scalar, sequence View source |
- item1 - item2 invalid Line : 3 Column : 1 Expected : DASH DOC_END DOC_START EOL Got : PLAIN Where : YAML/PP/Parser.pm line 392 YAML : "invalid" at YAML/PP/Loader.pm line 94. |
||||
| U44R - Bad indentation in mapping (2) | |||||
| Tags: double, error, indent, mapping View source |
map: key1: "quoted1" key2: "bad indentation" Line : 3 Column : 4 Message : Bad indendation in MAP Where : YAML/PP/Parser.pm line 204 YAML : "key2: \"bad indentation\"\n" at YAML/PP/Loader.pm line 94. |
||||
| U99R - Invalid comma in tag | |||||
| Tags: error, tag View source |
- !!str, xxx Line : 1 Column : 8 Expected : EOL WS Got : FLOW_COMMA Where : YAML/PP/Parser.pm line 392 YAML : ", xxx\n" at YAML/PP/Loader.pm line 94. |
||||
| VJP3/00 - Flow collections over many lines | |||||
| Tags: View source |
k: { k : v } Line : 2 Column : 1 Message : Bad indendation in FLOWMAP Where : YAML/PP/Parser.pm line 199 YAML : "k\n" at YAML/PP/Loader.pm line 94. |
||||
| W9L4 - Literal block scalar with more spaces in first line | |||||
| Tags: error, literal, whitespace View source |
--- block scalar: | more spaces at the beginning are invalid Line : 4 Column : 3 Message : Bad indendation in MAP Where : YAML/PP/Parser.pm line 204 YAML : "more spaces at the beginning\n" at YAML/PP/Loader.pm line 94. |
||||
| X4QW - Comment without whitespace after block scalar indicator | |||||
| Tags: comment, error, folded, whitespace View source |
block: ># comment scalar Line : 1 Column : 9 Message : Invalid block scalar Where : YAML/PP/Lexer.pm line 556 YAML : "# comment" at YAML/PP/Loader.pm line 94. |
||||
| Y79Y/000 - Tabs in various contexts | |||||
| Tags: View source |
foo: | bar: 1 Line : 2 Column : 1 Message : Invalid block scalar Where : YAML/PP/Lexer.pm line 576 YAML : "\t" at YAML/PP/Loader.pm line 94. |
||||
| Y79Y/003 - Tabs in various contexts | |||||
| Tags: View source |
- [ foo, foo ] Line : 2 Column : 1 Message : Bad indendation in FLOWSEQ Where : YAML/PP/Parser.pm line 199 YAML : "\tfoo,\n" at YAML/PP/Loader.pm line 94. |
||||
| Y79Y/004 - Tabs in various contexts | |||||
| Tags: View source |
- - Line : 1 Column : 4 Message : Tabs can not be used for indentation Where : YAML/PP/Lexer.pm line 289 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| Y79Y/005 - Tabs in various contexts | |||||
| Tags: View source |
- - Line : 1 Column : 5 Message : Tabs can not be used for indentation Where : YAML/PP/Lexer.pm line 289 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| Y79Y/006 - Tabs in various contexts | |||||
| Tags: View source |
? - Line : 1 Column : 4 Message : Tabs can not be used for indentation Where : YAML/PP/Lexer.pm line 289 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| Y79Y/007 - Tabs in various contexts | |||||
| Tags: View source |
? - : - Line : 2 Column : 4 Message : Tabs can not be used for indentation Where : YAML/PP/Lexer.pm line 289 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| Y79Y/008 - Tabs in various contexts | |||||
| Tags: View source |
? key: Line : 1 Column : 7 Message : Tabs can not be used for indentation Where : YAML/PP/Lexer.pm line 289 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| Y79Y/009 - Tabs in various contexts | |||||
| Tags: View source |
? key: : key: Line : 2 Column : 7 Message : Tabs can not be used for indentation Where : YAML/PP/Lexer.pm line 289 YAML : "" at YAML/PP/Loader.pm line 94. |
||||
| YJV2 - Dash in flow sequence | |||||
| Tags: flow, sequence View source |
[-] Line : 1 Column : 2 Message : Invalid plain scalar Where : YAML/PP/Lexer.pm line 378 YAML : "-]" at YAML/PP/Loader.pm line 94. |
||||
| ZCZ6 - Invalid mapping in plain single line value | |||||
| Tags: error, mapping, scalar View source |
a: b: c: d Line : 1 Column : 5 Expected : EOL Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ": c: d\n" at YAML/PP/Loader.pm line 94. |
||||
| ZL4Z - Invalid nested mapping | |||||
| Tags: error, mapping View source |
--- a: 'b': c Line : 2 Column : 7 Expected : EOL Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ": c\n" at YAML/PP/Loader.pm line 94. |
||||
| ZVH3 - Wrong indented sequence item | |||||
| Tags: error, indent, sequence View source |
- key: value - item1 Line : 2 Column : 2 Message : Expected SEQ Where : YAML/PP/Parser.pm line 239 YAML : "- item1\n" at YAML/PP/Loader.pm line 94. |
||||
| ZXT5 - Implicit key followed by newline and adjacent value | |||||
| Tags: error, flow, mapping, sequence View source |
[ "key" :value ] Line : 2 Column : 3 Expected : EOL FLOWSEQ_END FLOW_COMMA WS Got : COLON Where : YAML/PP/Parser.pm line 392 YAML : ":value ]\n" at YAML/PP/Loader.pm line 94. |
||||