Generated with YAML::PP v0.006_002
Valid (227)
Invalid (58)

Valid

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
--- 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
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
2JQS - Block Mapping with Missing Keys
Tags:
empty, mapping
View source
: a
: b


$doc1 = { "" => "b" }
Doc 1: {
   "" : "b"
}
---
'': b
: 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
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:
mapping, spec
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:
35KP - Tags for Root Objects
Tags:
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:
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, 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:
1.3-err, 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
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 - Spec Example 7.17. Flow Mapping Separate Values
Tags:
flow, mapping, spec
View source
{
unquoted : "separate",
http://foo.com,
omitted value:,
: omitted key,
}
Line      : 4
Column    : 13
Expected  : ALIAS DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START PLAIN SINGLEQUOTE
Got       : Invalid plain scalar
Where     : YAML/PP/Parser.pm line 487
YAML      : ":,\n"
  at YAML/PP/Loader.pm line 59.




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"
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 - Flow mapping colon on line after key
Tags:
mapping
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, 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
4QFQ - Spec Example 8.2. Block Indentation Indicator [1.3]
Tags:
1.3-mod, folded, libyaml-err, literal, scalar, spec
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
4UYU - Colon in Double Quoted String
Tags:
1.3-err, 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
4ZYM - Spec Example 6.4. Line Prefixes
Tags:
double, literal, scalar, spec, upto-1.2
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:
jayt
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
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:
scalar, spec, upto-1.2
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
5NYZ - Spec Example 6.9. Separated Comment
Tags:
comment, spec
View source
key:    # Comment
  value


$doc1 = { key => "value" }
Doc 1: {
   "key" : "value"
}
---
key: value
key: value
5TYM - Spec Example 6.21. Local Tag Prefix
Tags:
directive, 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, literal, mapping, 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
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, flow, mapping, sequence
View source
---
&mapping
&key [ &item a, b, c ]: value
Line      : 3
Column    : 14
Message   : A node can only have one anchor
Where     : YAML/PP/Parser.pm line 717
YAML      : ", b, c ]: value"
  at YAML/PP/Loader.pm line 59.




6CK3 - Spec Example 6.26. Tag Shorthands
Tags:
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:
scalar
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:
indent, spec, upto-1.2
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:
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
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, missing
View source
? &a a
: &b b
: *a


$doc1 = { "" => "a", "a" => "b" }
Doc 1: {
   "" : "a",
   "a" : "b"
}
---
'': a
a: b
&a a: &b b
: *a
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, 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, scalar, spec, whitespace
View source
---
"
  foo 
 
    bar

  baz
"


$doc1 = " foo\nbar\nbaz "
Doc 1: " foo\nbar\nbaz "
--- |2-
   foo
  bar
  baz 
--- " foo\nbar\nbaz "
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
---
...
---
matches %: 20
735Y - Spec Example 8.20. Block Node Types
Tags:
folded, spec
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
!!int 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
!!int 23: !!bool false
753E - Block Scalar Strip [1.3]
Tags:
1.3-mod, scalar
View source
--- |-
 ab
 
 
...


$doc1 = "ab"
Doc 1: "ab"
--- ab
--- |-
  ab
...
77H8 - Spec Example 2.23. Various Explicit Tags
Tags:
spec, tag
View source
---
not-date: !!str 2002-04-28

picture: !!binary |
 R0lGODlhDAAMAIQAAP//9/X
 17unp5WZmZgAAAOfn515eXv
 Pz7Y6OjuDg4J+fn5OTk6enp
 56enmleECcgggoBADs=

application specific tag: !something |
 The semantics of the tag
 above may be different for
 different documents.


$doc1 = {
  "application specific tag" => "The semantics of the tag\nabove may be different for\ndifferent documents.\n",
  "not-date" => "2002-04-28",
  "picture" => "R0lGODlhDAAMAIQAAP//9/X\n17unp5WZmZgAAAOfn515eXv\nPz7Y6OjuDg4J+fn5OTk6enp\n56enmleECcgggoBADs=\n",
}
Doc 1: {
   "application specific tag" : "The semantics of the tag\nabove may be different for\ndifferent documents.\n",
   "not-date" : "2002-04-28",
   "picture" : "R0lGODlhDAAMAIQAAP//9/X\n17unp5WZmZgAAAOfn515eXv\nPz7Y6OjuDg4J+fn5OTk6enp\n56enmleECcgggoBADs=\n"
}
---
application specific tag: |
  The semantics of the tag
  above may be different for
  different documents.
not-date: 2002-04-28
picture: |
  R0lGODlhDAAMAIQAAP//9/X
  17unp5WZmZgAAAOfn515eXv
  Pz7Y6OjuDg4J+fn5OTk6enp
  56enmleECcgggoBADs=
---
not-date: !!str 2002-04-28
picture: !!binary |
  R0lGODlhDAAMAIQAAP//9/X
  17unp5WZmZgAAAOfn515eXv
  Pz7Y6OjuDg4J+fn5OTk6enp
  56enmleECcgggoBADs=
application specific tag: !something |
  The semantics of the tag
  above may be different for
  different documents.
7A4E - Spec Example 7.6. Double Quoted Lines
Tags:
scalar, spec, upto-1.2
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
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, 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:
spec, 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, mapping
View source
---
[ word1
# comment
, word2]


$doc1 = ["word1", "word2"]
Doc 1: [
   "word1",
   "word2"
]
---
- word1
- word2
---
- word1
- word2
7W2P - Block Mapping with Missing Values
Tags:
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,
 ]
Line      : 2
Column    : 22
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": value,  "
  at YAML/PP/Loader.pm line 59.




8CWC - Plain mapping key ending with colon
Tags:
mapping, scalar
View source
---
key ends with two colons::: value
Line      : 2
Column    : 24
Expected  : COLON COMMENT EOL WS
Got       : Invalid plain scalar
Where     : YAML/PP/Parser.pm line 487
YAML      : "::: value\n"
  at YAML/PP/Loader.pm line 59.




8G76 - Spec Example 6.10. Comment Lines
Tags:
comment, empty, scalar, spec
View source
  # Comment
   








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,
]
Line      : 7
Column    : 6
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": pair,"
  at YAML/PP/Loader.pm line 59.




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, 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.
98YD - Spec Example 5.5. Comment Indicator
Tags:
comment, empty, spec
View source
# Comment only.






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
---
...
---
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
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 - Spec Example 7.21. Single Pair Implicit Entries [1.3
Tags:
1.3-mod, flow, mapping, spec
View source
- [ YAML : separate ]
- [ : empty key entry ]
- [ "JSON like":adjacent ]
Line      : 1
Column    : 9
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": separate ]"
  at YAML/PP/Loader.pm line 59.




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, scalar, spec
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, 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"
9YRD - Multiline Scalar at Top Level
Tags:
1.3-err, scalar
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:
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:
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:
mapping, sequence
View source
1:
- 2
- 3
4: 5


$doc1 = { 1 => [2, 3], 4 => 5 }
Doc 1: {
   "1" : [
      2,
      3
   ],
   "4" : 5
}
---
'1':
- 2
- 3
'4': 5
1:
- 2
- 3
4: 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
--- "foo"
BU8L - Node Anchor and Tag on Seperate Lines
Tags:
1.3-err, anchor, indent
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":
}
Line      : 5
Column    : 0
Expected  : ALIAS DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START PLAIN SINGLEQUOTE
Got       : FLOWMAP_END
Where     : YAML/PP/Parser.pm line 487
YAML      : "}"
  at YAML/PP/Loader.pm line 59.




C4HZ - Spec Example 2.24. Global Tags
Tags:
alias, directive, 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
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"
CN3R - Various location of anchors in flow sequence
Tags:
anchor, flow
View source
&flowseq [
 a: b,
 &c c: d,
 { &e e: f },
 &g { g: h }
]
Line      : 2
Column    : 2
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": b, "
  at YAML/PP/Loader.pm line 59.




CT4Q - Spec Example 7.20. Single Pair Explicit Entry
Tags:
flow, mapping, spec
View source
[
? foo
 bar : baz
]
Line      : 2
Column    : 0
Expected  : ALIAS DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START PLAIN SINGLEQUOTE
Got       : QUESTION
Where     : YAML/PP/Parser.pm line 487
YAML      : "? foo"
  at YAML/PP/Loader.pm line 59.




CUP7 - Spec Example 5.6. Node Property Indicators
Tags:
alias, 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
CXX2 - Mapping with anchor on document start line
Tags:
anchor, header, mapping
View source
--- &anchor a: b


$doc1 = { a => "b" }
Doc 1: {
   "a" : "b"
}
---
a: b
---
&anchor a: b
D83L - Block scalar indicator order
Tags:
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
DFF7 - Spec Example 7.16. Flow Mapping Entries
Tags:
flow, mapping, spec
View source
{
? explicit: entry,
implicit: entry,
?
}
Line      : 2
Column    : 0
Expected  : ALIAS DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START PLAIN SINGLEQUOTE
Got       : QUESTION
Where     : YAML/PP/Parser.pm line 487
YAML      : "? explicit: entry,"
  at YAML/PP/Loader.pm line 59.




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
DWX9 - Spec Example 8.8. Literal Content
Tags:
1.3-err, comment, literal, scalar, spec
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
*a : *b


$doc1 = { a => "b" }
Doc 1: {
   "a" : "b"
}
---
a: b
&a a: &b b
*a : *b
EHF6 - Tags for Flow Objects
Tags:
flow, 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
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
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:
flow, scalar, spec
View source
{
  ? foo :,
  : bar,
}
Line      : 2
Column    : 2
Expected  : ALIAS DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START PLAIN SINGLEQUOTE
Got       : QUESTION
Where     : YAML/PP/Parser.pm line 487
YAML      : "? foo :,\n  "
  at YAML/PP/Loader.pm line 59.




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:
mapping
View source
? a
: 13
1.5: d


$doc1 = { "1.5" => "d", "a" => 13 }
Doc 1: {
   "1.5" : "d",
   "a" : 13
}
---
'1.5': d
a: 13
a: 13
1.5: d
H2RW - Blank lines
Tags:
comment, scalar
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:
mapping
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 ☮
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
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
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
View source
# 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
1: 2


3: 4


$doc1 = { 1 => 2, 3 => 4 }
Doc 1: {
   "1" : 2,
   "3" : 4
}
---
'1': 2
'3': 4
1: 2
3: 4
J9HZ - Spec Example 2.9. Single Document with Two Comments
Tags:
comment, 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
JDH8 - Plain Scalar looking like key, comment, anchor and tag [1.3]
Tags:
1.3-mod, 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
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:
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
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:
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:
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, 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: |+

KK5P - Various combinations of explicit block mappings
Tags:
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
KZN9 - Spec Example 7.21. Single Pair Implicit Entries
Tags:
1.3-err, flow, mapping, spec
View source
- [ YAML : separate ]
- [ : empty key entry ]
- [ {JSON: like}:adjacent ]
Line      : 1
Column    : 9
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": separate ]"
  at YAML/PP/Loader.pm line 59.




L94M - Tags in Explicit Mapping
Tags:
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,
 ]
Line      : 2
Column    : 20
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": value,  "
  at YAML/PP/Loader.pm line 59.




LE5A - Spec Example 7.24. Flow Nodes
Tags:
alias, flow, 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,
 ]
Line      : 2
Column    : 22
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": value,  "
  at YAML/PP/Loader.pm line 59.




LX3P - Implicit Flow Mapping Key on one line
Tags:
1.3-err, flow, mapping, sequence
View source
[flow]: block
Unexpected at YAML/PP/Parser.pm line 525.
 at YAML/PP/Loader.pm line 59.




M29M - Literal Block Scalar
Tags:
scalar
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
...
M5C3 - Spec Example 8.21. Block Scalar Nodes
Tags:
1.3-err, folded, literal, spec
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:
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
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 = undef
$doc3 = "%!PS-Adobe-2.0 # Not the first line\n"
Doc 1: "Bare document"

Doc 2: null

Doc 3: "%!PS-Adobe-2.0 # Not the first line\n"
--- Bare document
--- null
--- |
  %!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
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, 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
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, scalar
View source
|-
 ab
 
 
...


$doc1 = "ab"
Doc 1: "ab"
--- ab
|-
  ab
...
MZX3 - Non-Specific Tags on Scalars
Tags:
scalar, tag
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
NHX8 - Empty Lines at End of Document
Tags:
whitespace
View source
:





$doc1 = { "" => undef }
Doc 1: {
   "" : null
}
---
'': null
:
NP9H - Spec Example 7.5. Double Quoted Line Breaks
Tags:
scalar, spec, upto-1.2
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
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, spec, upto-1.2
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, empty, missing
View source
- &a
- a
-
  &a : a
  b: &b
  &c : &a
-
  ? &d
  ? &e
  : &a


$doc1 = [undef, "a", { "" => undef, "b" => undef }, { "" => undef }]
Doc 1: [
   null,
   "a",
   {
      "" : null,
      "b" : null
   },
   {
      "" : null
   }
]
---
- null
- a
- '': null
  b: 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
	{}
Line      : 1
Column    : 0
Expected  : ALIAS COLON DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START FOLDED LITERAL PLAIN QUESTION SINGLEQUOTE
Got       : WS
Where     : YAML/PP/Parser.pm line 487
YAML      : "\t{}"
  at YAML/PP/Loader.pm line 59.




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, scalar, spec
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, spec, whitespace
View source
{ first: Sammy, last: Sosa }:
# Statistics:
  hr:  # Home runs
     65
  avg: # Average
   0.278
Unexpected at YAML/PP/Parser.pm line 525.
 at YAML/PP/Loader.pm line 59.




QF4Y - Spec Example 7.19. Single Pair Flow Mappings
Tags:
flow, mapping, spec
View source
[
foo: bar
]
Line      : 2
Column    : 3
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": bar"
  at YAML/PP/Loader.pm line 59.




R4YG - Spec Example 8.2. Block Indentation Indicator
Tags:
folded, libyaml-err, literal, scalar, spec, upto-1.2
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
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:
mapping
View source
a: 4.2
? 23
: d


$doc1 = { 23 => "d", a => 4.2 }
Doc 1: {
   "23" : "d",
   "a" : 4.2
}
---
'23': d
a: 4.2
a: 4.2
23: d
RTP8 - Spec Example 9.2. Document Markers
Tags:
footer, header, spec
View source
%YAML 1.2
---
Document
... # Suffix


$doc1 = "Document"
Doc 1: "Document"
--- Document
--- Document
...
RZP5 - Various Trailing Comments [1.3]
Tags:
1.3-mod, comment
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:
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
...
S98Z - Block scalar with spaces only
Tags:
comment, folded, scalar, whitespace
View source
empty block scalar: >
 
  
   
 # comment


$doc1 = { "empty block scalar" => "" }
Doc 1: {
   "empty block scalar" : ""
}
---
empty block scalar: ''
empty block scalar: ""
S9E8 - Spec Example 5.3. Block Structure Indicators
Tags:
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:
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, sequence
View source
---
seq:
 &anchor
- a
- b


$doc1 = { seq => ["a", "b"] }
Doc 1: {
   "seq" : [
      "a",
      "b"
   ]
}
---
seq:
- a
- b
---
seq: &anchor
- a
- b
SSW6 - Spec Example 7.7. Single Quoted Characters [1.3]
Tags:
1.3-mod, 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"'
SYW4 - Spec Example 2.2. Mapping Scalars to Scalars
Tags:
comment, literal, 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
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, spec
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
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:
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, 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
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.
UT92 - Spec Example 9.4. Explicit Documents
Tags:
comment, footer, header, spec
View source
---
{ matches
% : 20 }
...
---
# Empty
...
Line      : 3
Column    : 0
Expected  : ALIAS DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START PLAIN SINGLEQUOTE
Got       : Invalid directive
Where     : YAML/PP/Parser.pm line 487
YAML      : "% : 20 }\n"
  at YAML/PP/Loader.pm line 59.




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:
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
W42U - Spec Example 8.15. Block Sequence Entry Types
Tags:
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
--- |
  %!PS-Adobe-2.0
...
---
...
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
View source
{
  foo : !!str,
  !!str : bar,
}
Line      : 2
Column    : 13
Expected  : ALIAS DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START PLAIN SINGLEQUOTE
Got       : FLOW_COMMA
Where     : YAML/PP/Parser.pm line 487
YAML      : ",  "
  at YAML/PP/Loader.pm line 59.




X38W - Aliases in Flow Objects
Tags:
alias, flow
View source
{ &a [a, &b b]: *b, *a : [c, *b, d]}


$doc1 = { "['a','b']" => ["c", "b", "d"] }
Doc 1: {
   "['a','b']" : [
      "c",
      "b",
      "d"
   ]
}
---
'[''a'',''b'']':
- c
- b
- d
? &a
  - a
  - &b b
: *b
*a :
- c
- *b
- d
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, 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
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
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, literal, spec
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
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:
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:
jayt
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
ZWK4 - Key with anchor after missing explicit mapping value
Tags:
anchor, 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

Invalid

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    : 7
Expected  : COLON WS
Got       : EOL
Where     : YAML/PP/Parser.pm line 487
YAML      : ""
  at YAML/PP/Loader.pm line 59.




2CMS - Invalid mapping in plain multiline
Tags:
error, mapping
View source
this
 is
  invalid: x
Line      : 3
Column    : 0
Expected  : COMMENT EOL
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": x"
  at YAML/PP/Loader.pm line 59.




3HFZ - Invalid content after document end marker
Tags:
error, footer
View source
---
key: value
... invalid
Line      : 3
Column    : 0
Message   : Expected EOL
Where     : YAML/PP/Parser.pm line 144
YAML      : " invalid"
  at YAML/PP/Loader.pm line 59.




4H7K - Flow sequence with invalid extra closing bracket
Tags:
error, flow
View source
---
[ a, b, c ] ]
Unexpected at YAML/PP/Parser.pm line 525.
 at YAML/PP/Loader.pm line 59.




4HVU - Wrong indendation in Sequence
Tags:
error, indent, sequence
View source
key:
   - ok
   - also ok
  - wrong
Line      : 4
Column    : 2
Message   : Expected MAP
Where     : YAML/PP/Parser.pm line 345
YAML      : "- wrong  "
  at YAML/PP/Loader.pm line 59.




4JVG - Scalar value with two anchors
Tags:
anchor, error
View source
top1: &node1
  &k1 key1: val1
top2: &node2
  &v2 val2
Line      : 4
Column    : ???
Message   : A node can only have one anchor
Where     : YAML/PP/Parser.pm line 717
YAML      : ""
  at YAML/PP/Loader.pm line 59.




55WF - Invalid escape in double quoted string
Tags:
double, error
View source
---
"\."
Line      : 2
Column    : 1
Expected  : DOUBLEQUOTE
Got       : Invalid quoted string
Where     : YAML/PP/Parser.pm line 487
YAML      : "\\.\"\n"
  at YAML/PP/Loader.pm line 59.




5LLU - Block scalar with wrong indented line after spaces only
Tags:
error, folded, whitespace
View source
block scalar: >
 
  
   
 invalid
Line      : 5
Column    : 1
Message   : Bad indendation in MAP
Where     : YAML/PP/Parser.pm line 315
YAML      : "invalid "
  at YAML/PP/Loader.pm line 59.




5TRB - Invalid document-start marker in doublequoted tring
Tags:
double, error, header
View source
---
"
---
"
Line      : 3
Column    : 0
Expected  : DOUBLEQUOTED_LINE EOL
Got       : END
Where     : YAML/PP/Parser.pm line 487
YAML      : "---"
  at YAML/PP/Loader.pm line 59.




5U3A - Sequence on same Line as Mapping Key
Tags:
error, mapping, sequence
View source
key: - a
     - b
Line      : 1
Column    : 5
Expected  : ALIAS DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START FOLDED LITERAL PLAIN SINGLEQUOTE
Got       : DASH
Where     : YAML/PP/Parser.pm line 487
YAML      : "- a"
  at YAML/PP/Loader.pm line 59.




6JTT - Flow sequence without closing bracket
Tags:
error, flow
View source
---
[ [ a, b, c ]
Unexpected end of flow context at YAML/PP/Parser.pm line 355.
 at YAML/PP/Loader.pm line 59.




6S55 - Invalid scalar at the end of sequence
Tags:
error, mapping, sequence
View source
key:
 - bar
 - baz
 invalid
Line      : 4
Column    : 1
Expected  : DASH
Got       : PLAIN
Where     : YAML/PP/Parser.pm line 487
YAML      : "invalid "
  at YAML/PP/Loader.pm line 59.




7LBH - Multiline double quoted implicit keys
Tags:
error
View source
"a\nb": 1
"c
 d": 1
Line      : 2
Column    : 1
Expected  : DOUBLEQUOTED
Got       : DOUBLEQUOTED_LINE
Where     : YAML/PP/Parser.pm line 487
YAML      : "c"
  at YAML/PP/Loader.pm line 59.




7MNF - Missing colon
Tags:
error, mapping
View source
top1:
  key1: val1
top2
Line      : 3
Column    : 4
Expected  : COLON WS
Got       : EOL
Where     : YAML/PP/Parser.pm line 487
YAML      : ""
  at YAML/PP/Loader.pm line 59.




8XDJ - Comment in plain multiline value
Tags:
comment, error, scalar
View source
key: word1
#  xxx
  word2
Line      : 3
Column    : 2
Message   : Bad indendation in MAP
Where     : YAML/PP/Parser.pm line 315
YAML      : "word2  "
  at YAML/PP/Loader.pm line 59.




9C9N - Wrong indented flow sequence
Tags:
error, flow, indent, sequence
View source
---
flow: [a,
b,
c]


$doc1 = { flow => ["a", "b", "c"] }
Doc 1: {
   "flow" : [
      "a",
      "b",
      "c"
   ]
}
---
flow:
- a
- b
- c
---
flow:
- a
- b
- c
9CWY - Invalid scalar at the end of mapping
Tags:
error, mapping, sequence
View source
key:
 - item1
 - item2
invalid
Line      : 4
Column    : 7
Expected  : COLON WS
Got       : EOL
Where     : YAML/PP/Parser.pm line 487
YAML      : ""
  at YAML/PP/Loader.pm line 59.




9KBC - Mapping starting at --- line
Tags:
error, header, mapping
View source
--- key1: value1
    key2: value2
Line      : 2
Column    : 0
Expected  : COMMENT EOL
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": value2"
  at YAML/PP/Loader.pm line 59.




9MAG - Flow sequence with invalid comma at the beginning
Tags:
error, flow
View source
---
[ , a, b, c ]
Line      : 2
Column    : 2
Expected  : ALIAS DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START PLAIN SINGLEQUOTE
Got       : FLOW_COMMA
Where     : YAML/PP/Parser.pm line 487
YAML      : ", a, b, c ]"
  at YAML/PP/Loader.pm line 59.




B63P - Directive without document
Tags:
directive, document, error
View source
%YAML 1.2
...
Line      : 2
Column    : 0
Message   : Expected ---
Where     : YAML/PP/Parser.pm line 213
YAML      : "..."
  at YAML/PP/Loader.pm line 59.




BD7L - Invalid mapping after sequence
Tags:
error, mapping, sequence
View source
- item1
- item2
invalid: x
Line      : 3
Column    : 0
Expected  : DASH
Got       : PLAIN
Where     : YAML/PP/Parser.pm line 487
YAML      : "invalid: x"
  at YAML/PP/Loader.pm line 59.




BF9H - Trailing comment in multiline plain scalar
Tags:
comment, error, scalar
View source
---
plain: a
       b # end of scalar
       c
Line      : 4
Column    : 7
Message   : Bad indendation in MAP
Where     : YAML/PP/Parser.pm line 315
YAML      : "c       "
  at YAML/PP/Loader.pm line 59.




BS4K - Comment between plain scalar lines
Tags:
error
View source
word1  # comment
word2
Line      : 2
Column    : 0
Message   : Expected ---
Where     : YAML/PP/Parser.pm line 213
YAML      : "word2"
  at YAML/PP/Loader.pm line 59.




C2SP - Flow Mapping Key on two lines
Tags:
error, flow, mapping
View source
[23
]: 42
Unexpected at YAML/PP/Parser.pm line 525.
 at YAML/PP/Loader.pm line 59.




CML9 - Missing comma in flow
Tags:
comment, error, flow
View source
key: [ word1
#  xxx
  word2 ]
Line      : 3
Column    : 2
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : PLAIN
Where     : YAML/PP/Parser.pm line 487
YAML      : "word2 ]  "
  at YAML/PP/Loader.pm line 59.




CQ3W - Double quoted string without closing quote
Tags:
double, error
View source
---
key: "missing closing quote
Line      : 2
Column    : 0
Expected  : DOUBLEQUOTED_LINE EOL
Got       : END
Where     : YAML/PP/Parser.pm line 487
YAML      : ""
  at YAML/PP/Loader.pm line 59.




CTN5 - Flow sequence with invalid extra comma
Tags:
error, flow
View source
---
[ a, b, c, , ]
Line      : 2
Column    : 11
Expected  : ALIAS DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START PLAIN SINGLEQUOTE
Got       : FLOW_COMMA
Where     : YAML/PP/Parser.pm line 487
YAML      : ", ]"
  at YAML/PP/Loader.pm line 59.




D49Q - Multiline single quoted implicit keys
Tags:
error, mapping, single
View source
'a\nb': 1
'c
 d': 1
Line      : 2
Column    : 1
Expected  : SINGLEQUOTED
Got       : SINGLEQUOTED_LINE
Where     : YAML/PP/Parser.pm line 487
YAML      : "c"
  at YAML/PP/Loader.pm line 59.




DMG6 - Wrong indendation in Map
Tags:
error, indent, mapping
View source
key:
  ok: 1
 wrong: 2
Line      : 3
Column    : 1
Message   : Expected MAP
Where     : YAML/PP/Parser.pm line 345
YAML      : "wrong: 2 "
  at YAML/PP/Loader.pm line 59.




EB22 - Missing document-end marker before directive
Tags:
directive, error, footer
View source
---
scalar1 # comment
%YAML 1.2
---
scalar2
Line      : 3
Column    : 0
Message   : Expected ---
Where     : YAML/PP/Parser.pm line 204
YAML      : "%YAML 1.2"
  at YAML/PP/Loader.pm line 59.




EW3V - Wrong indendation in mapping
Tags:
error, indent, mapping
View source
k1: v1
 k2: v2
Line      : 2
Column    : 0
Expected  : COMMENT EOL
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": v2"
  at YAML/PP/Loader.pm line 59.




G7JE - Multiline implicit keys
Tags:
error, mapping
View source
a\nb: 1
c
 d: 1
Line      : 2
Column    : 1
Expected  : COLON WS
Got       : EOL
Where     : YAML/PP/Parser.pm line 487
YAML      : ""
  at YAML/PP/Loader.pm line 59.




G9HC - Invalid anchor in zero indented sequence
Tags:
anchor, error, sequence
View source
---
seq:
&anchor
- a
- b
Line      : 3
Column    : 7
Expected  : WS
Got       : EOL
Where     : YAML/PP/Parser.pm line 487
YAML      : ""
  at YAML/PP/Loader.pm line 59.




GDY7 - Comment that looks like a mapping key
Tags:
comment, error, mapping
View source
key: value
this is #not a: key
Line      : 2
Column    : 7
Expected  : COLON WS
Got       : COMMENT
Where     : YAML/PP/Parser.pm line 487
YAML      : " #not a: key"
  at YAML/PP/Loader.pm line 59.




GT5M - Node anchor in sequence
Tags:
anchor, error, sequence
View source
- item1
&node
- item2
Line      : 2
Column    : 0
Expected  : DASH
Got       : ANCHOR
Where     : YAML/PP/Parser.pm line 487
YAML      : "&node"
  at YAML/PP/Loader.pm line 59.




H7J7 - Node anchor not indented
Tags:
anchor, error, indent
View source
key: &x
!!map
  a: b
Line      : 2
Column    : 5
Expected  : WS
Got       : EOL
Where     : YAML/PP/Parser.pm line 487
YAML      : ""
  at YAML/PP/Loader.pm line 59.




HRE5 - Double quoted scalar with escaped single quote
Tags:
double, error, single
View source
---
double: "quoted \' scalar"
Line      : 2
Column    : 16
Expected  : DOUBLEQUOTE
Got       : Invalid quoted string
Where     : YAML/PP/Parser.pm line 487
YAML      : "\\' scalar\"\n"
  at YAML/PP/Loader.pm line 59.




HU3P - Invalid Mapping in plain scalar
Tags:
error, mapping, scalar
View source
key:
  word1 word2
  no: key
Line      : 3
Column    : 0
Expected  : COMMENT EOL
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": key"
  at YAML/PP/Loader.pm line 59.




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    : 15
Expected  : EOL
Got       : WS
Where     : YAML/PP/Parser.pm line 487
YAML      : " no key: nor value"
  at YAML/PP/Loader.pm line 59.




LHL4 - Invalid tag
Tags:
error, tag
View source
---
!invalid{}tag scalar
Line      : 2
Column    : 8
Expected  : EOL WS
Got       : FLOWMAP_START
Where     : YAML/PP/Parser.pm line 487
YAML      : "{}tag scalar"
  at YAML/PP/Loader.pm line 59.




N4JP - Bad indentation in mapping
Tags:
double, error, indent, mapping
View source
map:
  key1: "quoted1"
 key2: "bad indentation"
Line      : 3
Column    : 1
Message   : Expected MAP
Where     : YAML/PP/Parser.pm line 345
YAML      : "key2: \"bad indentation\" "
  at YAML/PP/Loader.pm line 59.




N782 - Invalid document markers in flow style
Tags:
edge, error, flow, footer, header
View source
[
--- ,
...
]
Unexpected end of flow context at YAML/PP/Parser.pm line 355.
 at YAML/PP/Loader.pm line 59.




NTY5 - Missing space in YAML directive
Tags:
directive, error
View source
%YAML1.2
---
key: value
Line      : 1
Column    : 0
Expected  : ALIAS COLON DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START FOLDED LITERAL PLAIN QUESTION SINGLEQUOTE
Got       : Invalid directive
Where     : YAML/PP/Parser.pm line 487
YAML      : "%YAML1.2\n"
  at YAML/PP/Loader.pm line 59.




Q4CL - Trailing content after quoted value
Tags:
double, error, mapping
View source
key1: "quoted1"
key2: "quoted2" trailing content
key3: "quoted3"
Line      : 2
Column    : 15
Expected  : EOL
Got       : WS
Where     : YAML/PP/Parser.pm line 487
YAML      : " trailing content"
  at YAML/PP/Loader.pm line 59.




QB6E - Wrong indented multiline quoted scalar
Tags:
double, error, indent
View source
---
quoted: "a
b
c"
Line      : 3
Column    : 0
Expected  : DOUBLEQUOTED_LINE EOL
Got       : END
Where     : YAML/PP/Parser.pm line 487
YAML      : "b"
  at YAML/PP/Loader.pm line 59.




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/Render.pm line 28.
 at YAML/PP/Loader.pm line 59.




RXY3 - Invalid document-end marker in single quoted string
Tags:
error, footer, single
View source
---
'
...
'
Line      : 3
Column    : 0
Expected  : EOL SINGLEQUOTED_LINE
Got       : END
Where     : YAML/PP/Parser.pm line 487
YAML      : "..."
  at YAML/PP/Loader.pm line 59.




SR86 - Anchor plus Alias
Tags:
alias, error
View source
key1: &a value
key2: &b *a
Line      : 2
Column    : ???
Message   : Parse error: Alias not allowed in this context
Where     : YAML/PP/Parser.pm line 745
YAML      : ""
  at YAML/PP/Loader.pm line 59.




SU5Z - Comment without whitespace after doublequoted scalar
Tags:
comment, double, error, whitespace
View source
key: "value"# invalid comment
Line      : 1
Column    : 12
Expected  : EOL
Got       : Invalid plain scalar
Where     : YAML/PP/Parser.pm line 487
YAML      : "# invalid comment\n"
  at YAML/PP/Loader.pm line 59.




SU74 - Anchor and alias as mapping key
Tags:
alias, anchor, error, mapping
View source
key1: &alias value1
&b *alias : value2
Line      : 2
Column    : 9
Message   : Parse error: Alias not allowed in this context
Where     : YAML/PP/Parser.pm line 745
YAML      : " : value2"
  at YAML/PP/Loader.pm line 59.




SY6V - Anchor before sequence entry on same line
Tags:
anchor, error, sequence
View source
&anchor - sequence entry
Line      : 1
Column    : 8
Expected  : ALIAS COLON DOUBLEQUOTE FLOWMAP_START FLOWSEQ_START FOLDED LITERAL PLAIN QUESTION SINGLEQUOTE
Got       : DASH
Where     : YAML/PP/Parser.pm line 487
YAML      : "- sequence entry"
  at YAML/PP/Loader.pm line 59.




TD5N - Invalid scalar after sequence
Tags:
error, scalar, sequence
View source
- item1
- item2
invalid
Line      : 3
Column    : 0
Expected  : DASH
Got       : PLAIN
Where     : YAML/PP/Parser.pm line 487
YAML      : "invalid"
  at YAML/PP/Loader.pm line 59.




U44R - Bad indentation in mapping (2)
Tags:
double, error, indent, mapping
View source
map:
  key1: "quoted1"
   key2: "bad indentation"
Line      : 3
Column    : 3
Message   : Bad indendation in MAP
Where     : YAML/PP/Parser.pm line 315
YAML      : "key2: \"bad indentation\"   "
  at YAML/PP/Loader.pm line 59.




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    : 2
Message   : Bad indendation in MAP
Where     : YAML/PP/Parser.pm line 315
YAML      : "more spaces at the beginning  "
  at YAML/PP/Loader.pm line 59.




X4QW - Comment without whitespace after block scalar indicator
Tags:
block, comment, error, whitespace
View source
block: ># comment
  scalar
Line      : 1
Column    : 8
Expected  : BLOCK_SCALAR_CHOMP BLOCK_SCALAR_INDENT EOL
Got       : Invalid plain scalar
Where     : YAML/PP/Parser.pm line 487
YAML      : "# comment\n"
  at YAML/PP/Loader.pm line 59.




ZCZ6 - Invalid mapping in plain single line value
Tags:
error, mapping, scalar
View source
a: b: c: d
Line      : 1
Column    : 4
Expected  : COMMENT EOL
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": c: d"
  at YAML/PP/Loader.pm line 59.




ZL4Z - Invalid nested mapping
Tags:
error, mapping
View source
---
a: 'b': c
Line      : 2
Column    : 6
Expected  : EOL
Got       : COLON
Where     : YAML/PP/Parser.pm line 487
YAML      : ": c"
  at YAML/PP/Loader.pm line 59.




ZVH3 - Wrong indented sequence item
Tags:
error, indent, sequence
View source
- key: value
 - item1
Line      : 2
Column    : 1
Message   : Expected SEQ
Where     : YAML/PP/Parser.pm line 345
YAML      : "- item1 "
  at YAML/PP/Loader.pm line 59.