in-yaml in-json test-event
# 229Q - Spec Example 2.4. Sequence of Mappings
Tags:
mapping, sequence, spec
Source
Test Results
-
  name: Mark McGwire
  hr:   65
  avg:  0.278
-
  name: Sammy Sosa
  hr:   63
  avg:  0.288
[
  {
    "name": "Mark McGwire",
    "hr": 65,
    "avg": 0.278
  },
  {
    "name": "Sammy Sosa",
    "hr": 63,
    "avg": 0.288
  }
]
+STR +DOC +SEQ +MAP =VAL :name =VAL :Mark McGwire =VAL :hr =VAL :65 =VAL :avg =VAL :0.278 -MAP +MAP =VAL :name =VAL :Sammy Sosa =VAL :hr =VAL :63 =VAL :avg =VAL :0.288 -MAP -SEQ -DOC -STR
# 26DV - Whitespace around colon in mappings
Tags:
alias, mapping, whitespace
Source
Test Results
"top1" : 
  "key1" : &alias1 scalar1
'top2' : 
  'key2' : &alias2 scalar2
top3: &node3 
  *alias1 : scalar3
top4: 
  *alias2 : scalar4
top5   :    
  scalar5
top6: 
  &anchor6 'key6' : scalar6
{
  "top1": {
    "key1": "scalar1"
  },
  "top2": {
    "key2": "scalar2"
  },
  "top3": {
    "scalar1": "scalar3"
  },
  "top4": {
    "scalar2": "scalar4"
  },
  "top5": "scalar5",
  "top6": {
    "key6": "scalar6"
  }
}
+STR +DOC +MAP =VAL "top1 +MAP =VAL "key1 =VAL &alias1 :scalar1 -MAP =VAL 'top2 +MAP =VAL 'key2 =VAL &alias2 :scalar2 -MAP =VAL :top3 +MAP &node3 =ALI *alias1 =VAL :scalar3 -MAP =VAL :top4 +MAP =ALI *alias2 =VAL :scalar4 -MAP =VAL :top5 =VAL :scalar5 =VAL :top6 +MAP =VAL &anchor6 'key6 =VAL :scalar6 -MAP -MAP -DOC -STR
# 27NA - Spec Example 5.9. Directive Indicator
Tags:
1.3-err, directive, spec
Source
Test Results
%YAML 1.2
--- text
"text"
+STR +DOC --- =VAL :text -DOC -STR
# 2AUY - Tags in Block Sequence
Tags:
sequence, tag
Source
Test Results
 - !!str a
 - b
 - !!int 42
 - d
[
  "a",
  "b",
  42,
  "d"
]
+STR +DOC +SEQ =VAL <tag:yaml.org,2002:str> :a =VAL :b =VAL <tag:yaml.org,2002:int> :42 =VAL :d -SEQ -DOC -STR
# 2EBW - Allowed characters in keys
Tags:
mapping
Source
Test Results
a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~: safe
?foo: safe question mark
:foo: safe colon
-foo: safe dash
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"
}
+STR +DOC +MAP =VAL :a!"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~ =VAL :safe =VAL :?foo =VAL :safe question mark =VAL ::foo =VAL :safe colon =VAL :-foo =VAL :safe dash =VAL :this is#not =VAL :a comment -MAP -DOC -STR
# 2JQS - Block Mapping with Missing Keys
Tags:
empty, mapping
Source
Test Results
: a
: b
+STR +DOC +MAP =VAL : =VAL :a =VAL : =VAL :b -MAP -DOC -STR
# 2LFX - Spec Example 6.13. Reserved Directives [1.3]
Tags:
1.3-mod, directive, double, header, spec
Source
Test Results
%FOO  bar baz # Should be ignored
              # with a warning.
---
"foo"
"foo"
+STR +DOC --- =VAL "foo -DOC -STR
# 2SXE - Anchors With Colon in Name
Tags:
1.3-err, alias, edge
Source
Test Results
&a: key: &a value
foo:
  *a:
{
  "key": "value",
  "foo": "key"
}
+STR +DOC +MAP =VAL &a: :key =VAL &a :value =VAL :foo =ALI *a: -MAP -DOC -STR
# 2XXW - Spec Example 2.25. Unordered Sets
Tags:
mapping, spec
Source
Test Results
# Sets are represented as a
# Mapping where each key is
# associated with a null value
--- !!set
? Mark McGwire
? Sammy Sosa
? Ken Griff
+STR +DOC --- +MAP <tag:yaml.org,2002:set> =VAL :Mark McGwire =VAL : =VAL :Sammy Sosa =VAL : =VAL :Ken Griff =VAL : -MAP -DOC -STR
# 35KP - Tags for Root Objects
Tags:
tag
Source
Test Results
--- !!map
? a
: b
--- !!seq
- !!str c
--- !!str
d
e
{
  "a": "b"
}
[
  "c"
]
"d e"
+STR +DOC --- +MAP <tag:yaml.org,2002:map> =VAL :a =VAL :b -MAP -DOC +DOC --- +SEQ <tag:yaml.org,2002:seq> =VAL <tag:yaml.org,2002:str> :c -SEQ -DOC +DOC --- =VAL <tag:yaml.org,2002:str> :d e -DOC -STR
# 36F6 - Multiline plain scalar with empty line
Tags:
scalar
Source
Test Results
---
plain: a
 b

 c
{
  "plain": "a b\nc"
}
+STR +DOC --- +MAP =VAL :plain =VAL :a b\nc -MAP -DOC -STR
# 3ALJ - Block Sequence in Block Sequence
Tags:
sequence
Source
Test Results
- - s1_i1
  - s1_i2
- s2
[
  [
    "s1_i1",
    "s1_i2"
  ],
  "s2"
]
+STR +DOC +SEQ +SEQ =VAL :s1_i1 =VAL :s1_i2 -SEQ =VAL :s2 -SEQ -DOC -STR
# 3GZX - Spec Example 7.1. Alias Nodes
Tags:
alias, spec
Source
Test Results
First occurrence: &anchor Foo
Second occurrence: *anchor
Override anchor: &anchor Bar
Reuse anchor: *anchor
{
  "First occurrence": "Foo",
  "Second occurrence": "Foo",
  "Override anchor": "Bar",
  "Reuse anchor": "Bar"
}
+STR +DOC +MAP =VAL :First occurrence =VAL &anchor :Foo =VAL :Second occurrence =ALI *anchor =VAL :Override anchor =VAL &anchor :Bar =VAL :Reuse anchor =ALI *anchor -MAP -DOC -STR
# 3MYT - Plain Scalar looking like key, comment, anchor and tag
Tags:
1.3-err, scalar
Source
Test Results
k:#foo
 &a !t s
"k:#foo &a !t s"
+STR +DOC =VAL :k:#foo &a !t s -DOC -STR
# 3R3P - Single block sequence with anchor
Tags:
anchor, sequence
Source
Test Results
&sequence
- a
[
  "a"
]
+STR +DOC +SEQ &sequence =VAL :a -SEQ -DOC -STR
# 3UYS - Escaped slash in double quotes
Tags:
double
Source
Test Results
escaped slash: "a\/b"
{
  "escaped slash": "a/b"
}
+STR +DOC +MAP =VAL :escaped slash =VAL "a/b -MAP -DOC -STR
# 4ABK - Spec Example 7.17. Flow Mapping Separate Values
Tags:
flow, mapping, spec
Source
Test Results
{
unquoted : "separate",
http://foo.com,
omitted value:,
: omitted key,
}
+STR +DOC +MAP =VAL :unquoted =VAL "separate =VAL :http://foo.com =VAL : =VAL :omitted value =VAL : =VAL : =VAL :omitted key -MAP -DOC -STR
# 4CQQ - Spec Example 2.18. Multi-line Flow Scalars
Tags:
scalar, spec
Source
Test Results
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.\n"
}
+STR +DOC +MAP =VAL :plain =VAL :This unquoted scalar spans many lines. =VAL :quoted =VAL "So does this quoted scalar.\n -MAP -DOC -STR
# 4GC6 - Spec Example 7.7. Single Quoted Characters
Tags:
1.3-err, scalar, spec
Source
Test Results
'here''s to "quotes"'
"here's to \"quotes\""
+STR +DOC =VAL 'here's to "quotes" -DOC -STR
# 4MUZ - Flow mapping colon on line after key
Tags:
mapping
Source
Test Results
{"foo"
: "bar"}
{
  "foo": "bar"
}
+STR +DOC +MAP =VAL "foo =VAL "bar -MAP -DOC -STR
# 4Q9F - Folded Block Scalar [1.3]
Tags:
1.3-mod, scalar
Source
Test Results
--- >
 ab
 cd
 
 ef


 gh
"ab cd\nef\n\ngh\n"
+STR +DOC --- =VAL >ab cd\nef\n\ngh\n -DOC -STR
# 4QFQ - Spec Example 8.2. Block Indentation Indicator [1.3]
Tags:
1.3-mod, folded, libyaml-err, literal, scalar, spec
Source
Test Results
- |
 detected
- >
 
  
  # detected
- |1
  explicit
- >
 detected
[
  "detected\n",
  "\n\n# detected\n",
  " explicit\n",
  "detected\n"
]
+STR +DOC +SEQ =VAL |detected\n =VAL >\n\n# detected\n =VAL | explicit\n =VAL >detected\n -SEQ -DOC -STR
# 4UYU - Colon in Double Quoted String
Tags:
1.3-err, scalar
Source
Test Results
"foo: bar\": baz"
"foo: bar\": baz"
+STR +DOC =VAL "foo: bar": baz -DOC -STR
# 4V8U - Plain scalar with backslashes
Tags:
scalar
Source
Test Results
---
plain\value\with\backslashes
"plain\\value\\with\\backslashes"
+STR +DOC --- =VAL :plain\\value\\with\\backslashes -DOC -STR
# 4ZYM - Spec Example 6.4. Line Prefixes
Tags:
double, literal, scalar, spec, upto-1.2
Source
Test Results
plain: text
  lines
quoted: "text
  	lines"
block: |
  text
   	lines
{
  "plain": "text lines",
  "quoted": "text lines",
  "block": "text\n \tlines\n"
}
+STR +DOC +MAP =VAL :plain =VAL :text lines =VAL :quoted =VAL "text lines =VAL :block =VAL |text\n \tlines\n -MAP -DOC -STR
# 52DL - Explicit Non-Specific Tag [1.3]
Tags:
1.3-mod, tag
Source
Test Results
---
! a
"a"
+STR +DOC --- =VAL <!> :a -DOC -STR
# 54T7 - Flow Mapping
Tags:
flow, mapping
Source
Test Results
{foo: you, bar: far}
{
  "foo": "you",
  "bar": "far"
}
+STR +DOC +MAP =VAL :foo =VAL :you =VAL :bar =VAL :far -MAP -DOC -STR
# 565N - Construct Binary
Tags:
jayt
Source
Test Results
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.
+STR +DOC +MAP =VAL :canonical =VAL <tag:yaml.org,2002:binary> "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= =VAL :generic =VAL <tag:yaml.org,2002:binary> |R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\nOTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\n+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\nAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=\n =VAL :description =VAL :The binary value above is a tiny arrow encoded as a gif image. -MAP -DOC -STR
# 57H4 - Spec Example 8.22. Block Collection Nodes
Tags:
mapping, sequence, tag
Source
Test Results
sequence: !!seq
- entry
- !!seq
 - nested
mapping: !!map
 foo: bar
{
  "sequence": [
    "entry",
    [
      "nested"
    ]
  ],
  "mapping": {
    "foo": "bar"
  }
}
+STR +DOC +MAP =VAL :sequence +SEQ <tag:yaml.org,2002:seq> =VAL :entry +SEQ <tag:yaml.org,2002:seq> =VAL :nested -SEQ -SEQ =VAL :mapping +MAP <tag:yaml.org,2002:map> =VAL :foo =VAL :bar -MAP -MAP -DOC -STR
# 5BVJ - Spec Example 5.7. Block Scalar Indicators
Tags:
folded, literal, scalar, spec
Source
Test Results
literal: |
  some
  text
folded: >
  some
  text
{
  "literal": "some\ntext\n",
  "folded": "some text\n"
}
+STR +DOC +MAP =VAL :literal =VAL |some\ntext\n =VAL :folded =VAL >some text\n -MAP -DOC -STR
# 5C5M - Spec Example 7.15. Flow Mappings
Tags:
flow, mapping, spec
Source
Test Results
- { one : two , three: four , }
- {five: six,seven : eight}
[
  {
    "one": "two",
    "three": "four"
  },
  {
    "five": "six",
    "seven": "eight"
  }
]
+STR +DOC +SEQ +MAP =VAL :one =VAL :two =VAL :three =VAL :four -MAP +MAP =VAL :five =VAL :six =VAL :seven =VAL :eight -MAP -SEQ -DOC -STR
# 5GBF - Spec Example 6.5. Empty Lines
Tags:
scalar, spec, upto-1.2
Source
Test Results
Folding:
  "Empty line
   	
  as a line feed"
Chomping: |
  Clipped empty lines
 

{
  "Folding": "Empty line\nas a line feed",
  "Chomping": "Clipped empty lines\n"
}
+STR +DOC +MAP =VAL :Folding =VAL "Empty line\nas a line feed =VAL :Chomping =VAL |Clipped empty lines\n -MAP -DOC -STR
# 5KJE - Spec Example 7.13. Flow Sequence
Tags:
flow, sequence, spec
Source
Test Results
- [ one, two, ]
- [three ,four]
[
  [
    "one",
    "two"
  ],
  [
    "three",
    "four"
  ]
]
+STR +DOC +SEQ +SEQ =VAL :one =VAL :two -SEQ +SEQ =VAL :three =VAL :four -SEQ -SEQ -DOC -STR
# 5MUD - Colon and adjacent value on next line
Tags:
double, flow, mapping
Source
Test Results
---
{ "foo"
  :bar }
{
  "foo": "bar"
}
+STR +DOC --- +MAP =VAL "foo =VAL :bar -MAP -DOC -STR
# 5NYZ - Spec Example 6.9. Separated Comment
Tags:
comment, spec
Source
Test Results
key:    # Comment
  value
{
  "key": "value"
}
+STR +DOC +MAP =VAL :key =VAL :value -MAP -DOC -STR
# 5TYM - Spec Example 6.21. Local Tag Prefix
Tags:
directive, spec, tag
Source
Test Results
%TAG !m! !my-
--- # Bulb here
!m!light fluorescent
...
%TAG !m! !my-
--- # Color here
!m!light green
+STR +DOC --- =VAL <!my-light> :fluorescent -DOC ... +DOC --- =VAL <!my-light> :green -DOC -STR
# 5WE3 - Spec Example 8.17. Explicit Block Mapping Entries
Tags:
comment, literal, mapping, spec
Source
Test Results
? explicit key # Empty value
? |
  block key
: - one # Explicit compact
  - two # block value
{
  "explicit key": null,
  "block key\n": [
    "one",
    "two"
  ]
}
+STR +DOC +MAP =VAL :explicit key =VAL : =VAL |block key\n +SEQ =VAL :one =VAL :two -SEQ -MAP -DOC -STR
# 65WH - Single Entry Block Sequence
Tags:
sequence
Source
Test Results
- foo
[
  "foo"
]
+STR +DOC +SEQ =VAL :foo -SEQ -DOC -STR
# 6BCT - Spec Example 6.3. Separation Spaces
Tags:
libyaml-err, sequence, spec, upto-1.2, whitespace
Source
Test Results
- foo:	 bar
- - baz
  -	baz
[
  {
    "foo": "bar"
  },
  [
    "baz",
    "baz"
  ]
]
+STR +DOC +SEQ +MAP =VAL :foo =VAL :bar -MAP +SEQ =VAL :baz =VAL :baz -SEQ -SEQ -DOC -STR
# 6BFJ - Mapping, key and flow sequence item anchors
Tags:
anchor, flow, mapping, sequence
Source
Test Results
---
&mapping
&key [ &item a, b, c ]: value
+STR +DOC --- +MAP &mapping +SEQ &key =VAL &item :a =VAL :b =VAL :c -SEQ =VAL :value -MAP -DOC -STR
# 6CK3 - Spec Example 6.26. Tag Shorthands
Tags:
spec, tag
Source
Test Results
%TAG !e! tag:example.com,2000:app/
---
- !local foo
- !!str bar
- !e!tag%21 baz
+STR +DOC --- +SEQ =VAL <!local> :foo =VAL <tag:yaml.org,2002:str> :bar =VAL <tag:example.com,2000:app/tag!> :baz -SEQ -DOC -STR
# 6FWR - Block Scalar Keep
Tags:
scalar
Source
Test Results
--- |+
 ab
 
  
...
"ab\n\n \n"
+STR +DOC --- =VAL |ab\n\n \n -DOC ... -STR
# 6H3V - Backslashes in singlequotes
Tags:
scalar, single
Source
Test Results
'foo: bar\': baz'
{
  "foo: bar\\": "baz'"
}
+STR +DOC +MAP =VAL 'foo: bar\\ =VAL :baz' -MAP -DOC -STR
# 6HB6 - Spec Example 6.1. Indentation Spaces
Tags:
indent, spec, upto-1.2
Source
Test Results
  # 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.
{
  "Not indented": {
    "By one space": "By four\n  spaces\n",
    "Flow style": [
      "By two",
      "Also by two",
      "Still by two"
    ]
  }
}
+STR +DOC +MAP =VAL :Not indented +MAP =VAL :By one space =VAL |By four\n spaces\n =VAL :Flow style +SEQ =VAL :By two =VAL :Also by two =VAL :Still by two -SEQ -MAP -MAP -DOC -STR
# 6JQW - Spec Example 2.13. In literals, newlines are preserved
Tags:
comment, literal, scalar, spec
Source
Test Results
# ASCII Art
--- |
  \//||\/||
  // ||  ||__
"\\//||\\/||\n// ||  ||__\n"
+STR +DOC --- =VAL |\\//||\\/||\n// || ||__\n -DOC -STR
# 6JWB - Tags for Block Objects
Tags:
tag
Source
Test Results
foo: !!seq
  - !!str a
  - !!map
    key: !!str value
{
  "foo": [
    "a",
    {
      "key": "value"
    }
  ]
}
+STR +DOC +MAP =VAL :foo +SEQ <tag:yaml.org,2002:seq> =VAL <tag:yaml.org,2002:str> :a +MAP <tag:yaml.org,2002:map> =VAL :key =VAL <tag:yaml.org,2002:str> :value -MAP -SEQ -MAP -DOC -STR
# 6KGN - Anchor for empty node
Tags:
alias, anchor
Source
Test Results
---
a: &anchor
b: *anchor
{
  "a": null,
  "b": null
}
+STR +DOC --- +MAP =VAL :a =VAL &anchor : =VAL :b =ALI *anchor -MAP -DOC -STR
# 6LVF - Spec Example 6.13. Reserved Directives
Tags:
1.3-err, directive, double, header, spec
Source
Test Results
%FOO  bar baz # Should be ignored
              # with a warning.
--- "foo"
"foo"
+STR +DOC --- =VAL "foo -DOC -STR
# 6M2F - Aliases in Explicit Block Mapping
Tags:
alias, missing
Source
Test Results
? &a a
: &b b
: *a
{
  "a": "b",
  "": "a"
}
+STR +DOC +MAP =VAL &a :a =VAL &b :b =VAL : =ALI *a -MAP -DOC -STR
# 6PBE - Zero-indented sequences in explicit mapping keys
Tags:
mapping, sequence
Source
Test Results
---
?
- a
- b
:
- c
- d
+STR +DOC --- +MAP +SEQ =VAL :a =VAL :b -SEQ +SEQ =VAL :c =VAL :d -SEQ -MAP -DOC -STR
# 6SLA - Allowed characters in quoted mapping key
Tags:
double, mapping, single
Source
Test Results
"foo\nbar:baz\tx \\$%^&*()x": 23
'x\ny:z\tx $%^&*()x': 24
{
  "foo\nbar:baz\tx \\$%^&*()x": 23,
  "x\\ny:z\\tx $%^&*()x": 24
}
+STR +DOC +MAP =VAL "foo\nbar:baz\tx \\$%^&*()x =VAL :23 =VAL 'x\\ny:z\\tx $%^&*()x =VAL :24 -MAP -DOC -STR
# 6VJK - Spec Example 2.15. Folded newlines are preserved for "more indented" and blank lines
Tags:
1.3-err, folded, scalar, spec
Source
Test Results
>
 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.\n\n  63 Home Runs\n  0.288 Batting Average\n\nWhat a year!\n"
+STR +DOC =VAL >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 -STR
# 6WLZ - Spec Example 6.18. Primary Tag Handle [1.3]
Tags:
1.3-mod, directive, spec, tag
Source
Test Results
# Private
---
!foo "bar"
...
# Global
%TAG ! tag:example.com,2000:app/
---
!foo "bar"
+STR +DOC --- =VAL <!foo> "bar -DOC ... +DOC --- =VAL <tag:example.com,2000:app/foo> "bar -DOC -STR
# 6WPF - Spec Example 6.8. Flow Folding [1.3]
Tags:
1.3-mod, scalar, spec, whitespace
Source
Test Results
---
"
  foo 
 
    bar

  baz
"
" foo\nbar\nbaz "
+STR +DOC --- =VAL " foo\nbar\nbaz -DOC -STR
# 6ZKB - Spec Example 9.6. Stream
Tags:
1.3-err, header, spec
Source
Test Results
Document
---
# Empty
...
%YAML 1.2
---
matches %: 20
"Document"
null
{
  "matches %": 20
}
+STR +DOC =VAL :Document -DOC +DOC --- =VAL : -DOC ... +DOC --- +MAP =VAL :matches % =VAL :20 -MAP -DOC -STR
# 735Y - Spec Example 8.20. Block Node Types
Tags:
folded, spec
Source
Test Results
-
  "flow in block"
- >
 Block scalar
- !!map # Block collection
  foo : bar
[
  "flow in block",
  "Block scalar\n",
  {
    "foo": "bar"
  }
]
+STR +DOC +SEQ =VAL "flow in block =VAL >Block scalar\n +MAP <tag:yaml.org,2002:map> =VAL :foo =VAL :bar -MAP -SEQ -DOC -STR
# 74H7 - Tags in Implicit Mapping
Tags:
mapping, tag
Source
Test Results
!!str a: b
c: !!int 42
e: !!str f
g: h
!!int 23: !!bool false
{
  "a": "b",
  "c": 42,
  "e": "f",
  "g": "h",
  "23": false
}
+STR +DOC +MAP =VAL <tag:yaml.org,2002:str> :a =VAL :b =VAL :c =VAL <tag:yaml.org,2002:int> :42 =VAL :e =VAL <tag:yaml.org,2002:str> :f =VAL :g =VAL :h =VAL <tag:yaml.org,2002:int> :23 =VAL <tag:yaml.org,2002:bool> :false -MAP -DOC -STR
# 753E - Block Scalar Strip [1.3]
Tags:
1.3-mod, scalar
Source
Test Results
--- |-
 ab
 
 
...
"ab"
+STR +DOC --- =VAL |ab -DOC ... -STR
# 77H8 - Spec Example 2.23. Various Explicit Tags
Tags:
spec, tag
Source
Test Results
---
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.
+STR +DOC --- +MAP =VAL :not-date =VAL <tag:yaml.org,2002:str> :2002-04-28 =VAL :picture =VAL <tag:yaml.org,2002:binary> |R0lGODlhDAAMAIQAAP//9/X\n17unp5WZmZgAAAOfn515eXv\nPz7Y6OjuDg4J+fn5OTk6enp\n56enmleECcgggoBADs=\n =VAL :application specific tag =VAL <!something> |The semantics of the tag\nabove may be different for\ndifferent documents.\n -MAP -DOC -STR
# 7A4E - Spec Example 7.6. Double Quoted Lines
Tags:
scalar, spec, upto-1.2
Source
Test Results
" 1st non-empty

 2nd non-empty 
	3rd non-empty "
" 1st non-empty\n2nd non-empty 3rd non-empty "
+STR +DOC =VAL " 1st non-empty\n2nd non-empty 3rd non-empty -DOC -STR
# 7BMT - Node and Mapping Key Anchors [1.3]
Tags:
1.3-mod, anchor, comment
Source
Test Results
---
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
{
  "top1": {
    "key1": "one"
  },
  "top2": {
    "key2": "two"
  },
  "top3": {
    "key3": "three"
  },
  "top4": {
    "key4": "four"
  },
  "top5": {
    "key5": "five"
  },
  "top6": "six",
  "top7": "seven"
}
+STR +DOC --- +MAP =VAL :top1 +MAP &node1 =VAL &k1 :key1 =VAL :one -MAP =VAL :top2 +MAP &node2 =VAL :key2 =VAL :two -MAP =VAL :top3 +MAP =VAL &k3 :key3 =VAL :three -MAP =VAL :top4 +MAP &node4 =VAL &k4 :key4 =VAL :four -MAP =VAL :top5 +MAP &node5 =VAL :key5 =VAL :five -MAP =VAL :top6 =VAL &val6 :six =VAL :top7 =VAL &val7 :seven -MAP -DOC -STR
# 7BUB - Spec Example 2.10. Node for “Sammy Sosa” appears twice in this document
Tags:
alias, spec
Source
Test Results
---
hr:
  - Mark McGwire
  # Following node labeled SS
  - &SS Sammy Sosa
rbi:
  - *SS # Subsequent occurrence
  - Ken Griffey
{
  "hr": [
    "Mark McGwire",
    "Sammy Sosa"
  ],
  "rbi": [
    "Sammy Sosa",
    "Ken Griffey"
  ]
}
+STR +DOC --- +MAP =VAL :hr +SEQ =VAL :Mark McGwire =VAL &SS :Sammy Sosa -SEQ =VAL :rbi +SEQ =ALI *SS =VAL :Ken Griffey -SEQ -MAP -DOC -STR
# 7FWL - Spec Example 6.24. Verbatim Tags
Tags:
spec, tag
Source
Test Results
!<tag:yaml.org,2002:str> foo :
  !<!bar> baz
+STR +DOC +MAP =VAL <tag:yaml.org,2002:str> :foo =VAL <!bar> :baz -MAP -DOC -STR
# 7T8X - Spec Example 8.10. Folded Lines - 8.13. Final Empty Lines
Tags:
1.3-err, comment, folded, scalar, spec
Source
Test Results
>

 folded
 line

 next
 line
   * bullet

   * list
   * lines

 last
 line

# Comment
"\nfolded line\nnext line\n  * bullet\n\n  * list\n  * lines\n\nlast line\n"
+STR +DOC =VAL >\nfolded line\nnext line\n * bullet\n\n * list\n * lines\n\nlast line\n -DOC -STR
# 7TMG - Comment in flow sequence before comma
Tags:
comment, flow, mapping
Source
Test Results
---
[ word1
# comment
, word2]
[
  "word1",
  "word2"
]
+STR +DOC --- +SEQ =VAL :word1 =VAL :word2 -SEQ -DOC -STR
# 7W2P - Block Mapping with Missing Values
Tags:
mapping
Source
Test Results
? a
? b
c:
{
  "a": null,
  "b": null,
  "c": null
}
+STR +DOC +MAP =VAL :a =VAL : =VAL :b =VAL : =VAL :c =VAL : -MAP -DOC -STR
# 7Z25 - Bare document after document end marker
Tags:
footer
Source
Test Results
---
scalar1
...
key: value
"scalar1"
{
  "key": "value"
}
+STR +DOC --- =VAL :scalar1 -DOC ... +DOC +MAP =VAL :key =VAL :value -MAP -DOC -STR
# 7ZZ5 - Empty flow collections
Tags:
flow, mapping, sequence
Source
Test Results
---
nested sequences:
- - - []
- - - {}
key1: []
key2: {}
{
  "nested sequences": [
    [
      [
        []
      ]
    ],
    [
      [
        {}
      ]
    ]
  ],
  "key1": [],
  "key2": {}
}
+STR +DOC --- +MAP =VAL :nested sequences +SEQ +SEQ +SEQ +SEQ -SEQ -SEQ -SEQ +SEQ +SEQ +MAP -MAP -SEQ -SEQ -SEQ =VAL :key1 +SEQ -SEQ =VAL :key2 +MAP -MAP -MAP -DOC -STR
# 82AN - Three dashes and content without space
Tags:
1.3-err, scalar
Source
Test Results
---word1
word2
"---word1 word2"
+STR +DOC =VAL :---word1 word2 -DOC -STR
# 87E4 - Spec Example 7.8. Single Quoted Implicit Keys
Tags:
flow, mapping, sequence, spec
Source
Test Results
'implicit block key' : [
  'implicit flow key' : value,
 ]
{
  "implicit block key": [
    {
      "implicit flow key": "value"
    }
  ]
}
+STR +DOC +MAP =VAL 'implicit block key +SEQ +MAP =VAL 'implicit flow key =VAL :value -MAP -SEQ -MAP -DOC -STR
# 8CWC - Plain mapping key ending with colon
Tags:
mapping, scalar
Source
Test Results
---
key ends with two colons::: value
{
  "key ends with two colons::": "value"
}
+STR +DOC --- +MAP =VAL :key ends with two colons:: =VAL :value -MAP -DOC -STR
# 8G76 - Spec Example 6.10. Comment Lines
Tags:
comment, empty, scalar, spec
Source
Test Results
  # Comment
   


+STR -STR
# 8KB6 - Multiline plain flow mapping key without value
Tags:
flow, mapping
Source
Test Results
---
- { single line, a: b}
- { multi
  line, a: b}
[
  {
    "single line": null,
    "a": "b"
  },
  {
    "multi line": null,
    "a": "b"
  }
]
+STR +DOC --- +SEQ +MAP =VAL :single line =VAL : =VAL :a =VAL :b -MAP +MAP =VAL :multi line =VAL : =VAL :a =VAL :b -MAP -SEQ -DOC -STR
# 8MK2 - Explicit Non-Specific Tag
Tags:
1.3-err, tag
Source
Test Results
! a
"a"
+STR +DOC =VAL <!> :a -DOC -STR
# 8QBE - Block Sequence in Block Mapping
Tags:
mapping, sequence
Source
Test Results
key:
 - item1
 - item2
{
  "key": [
    "item1",
    "item2"
  ]
}
+STR +DOC +MAP =VAL :key +SEQ =VAL :item1 =VAL :item2 -SEQ -MAP -DOC -STR
# 8UDB - Spec Example 7.14. Flow Sequence Entries
Tags:
flow, sequence, spec
Source
Test Results
[
"double
 quoted", 'single
           quoted',
plain
 text, [ nested ],
single: pair,
]
[
  "double quoted",
  "single quoted",
  "plain text",
  [
    "nested"
  ],
  {
    "single": "pair"
  }
]
+STR +DOC +SEQ =VAL "double quoted =VAL 'single quoted =VAL :plain text +SEQ =VAL :nested -SEQ +MAP =VAL :single =VAL :pair -MAP -SEQ -DOC -STR
# 8XYN - Anchor with unicode character
Tags:
anchor
Source
Test Results
---
- &😁 unicode anchor
[
  "unicode anchor"
]
+STR +DOC --- +SEQ =VAL &😁 :unicode anchor -SEQ -DOC -STR
# 93JH - Block Mappings in Block Sequence
Tags:
mapping, sequence
Source
Test Results
 - key: value
   key2: value2
 -
   key3: value3
[
  {
    "key": "value",
    "key2": "value2"
  },
  {
    "key3": "value3"
  }
]
+STR +DOC +SEQ +MAP =VAL :key =VAL :value =VAL :key2 =VAL :value2 -MAP +MAP =VAL :key3 =VAL :value3 -MAP -SEQ -DOC -STR
# 93WF - Spec Example 6.6. Line Folding [1.3]
Tags:
1.3-mod, scalar, spec, whitespace
Source
Test Results
--- >-
  trimmed
  
 

  as
  space
"trimmed\n\n\nas space"
+STR +DOC --- =VAL >trimmed\n\n\nas space -DOC -STR
# 96L6 - Spec Example 2.14. In the folded scalars, newlines become spaces
Tags:
folded, scalar, spec
Source
Test Results
--- >
  Mark McGwire's
  year was crippled
  by a knee injury.
"Mark McGwire's year was crippled by a knee injury.\n"
+STR +DOC --- =VAL >Mark McGwire's year was crippled by a knee injury.\n -DOC -STR
# 98YD - Spec Example 5.5. Comment Indicator
Tags:
comment, empty, spec
Source
Test Results
# Comment only.
+STR -STR
# 9BXH - Multiline doublequoted flow mapping key without value
Tags:
double, flow, mapping
Source
Test Results
---
- { "single line", a: b}
- { "multi
  line", a: b}
[
  {
    "single line": null,
    "a": "b"
  },
  {
    "multi line": null,
    "a": "b"
  }
]
+STR +DOC --- +SEQ +MAP =VAL "single line =VAL : =VAL :a =VAL :b -MAP +MAP =VAL "multi line =VAL : =VAL :a =VAL :b -MAP -SEQ -DOC -STR
# 9DXL - Spec Example 9.6. Stream [1.3]
Tags:
1.3-mod, header, spec
Source
Test Results
Mapping: Document
---
# Empty
...
%YAML 1.2
---
matches %: 20
{
  "Mapping": "Document"
}
null
{
  "matches %": 20
}
+STR +DOC +MAP =VAL :Mapping =VAL :Document -MAP -DOC +DOC --- =VAL : -DOC ... +DOC --- +MAP =VAL :matches % =VAL :20 -MAP -DOC -STR
# 9FMG - Multi-level Mapping Indent
Tags:
indent, mapping
Source
Test Results
a:
  b:
    c: d
  e:
    f: g
h: i
{
  "a": {
    "b": {
      "c": "d"
    },
    "e": {
      "f": "g"
    }
  },
  "h": "i"
}
+STR +DOC +MAP =VAL :a +MAP =VAL :b +MAP =VAL :c =VAL :d -MAP =VAL :e +MAP =VAL :f =VAL :g -MAP -MAP =VAL :h =VAL :i -MAP -DOC -STR
# 9J7A - Simple Mapping Indent
Tags:
indent, mapping, simple
Source
Test Results
foo:
  bar: baz
{
  "foo": {
    "bar": "baz"
  }
}
+STR +DOC +MAP =VAL :foo +MAP =VAL :bar =VAL :baz -MAP -MAP -DOC -STR
# 9KAX - Various combinations of tags and anchors
Tags:
1.3-err, anchor, mapping
Source
Test Results
---
&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
"scalar1"
"scalar2"
"scalar3"
{
  "key5": "value4"
}
{
  "a6": 1,
  "b6": 2
}
{
  "key8": "value7"
}
{
  "key10": "value9"
}
"value11"
+STR +DOC --- =VAL &a1 <tag:yaml.org,2002:str> :scalar1 -DOC +DOC --- =VAL &a2 <tag:yaml.org,2002:str> :scalar2 -DOC +DOC --- =VAL &a3 <tag:yaml.org,2002:str> :scalar3 -DOC +DOC --- +MAP &a4 <tag:yaml.org,2002:map> =VAL &a5 <tag:yaml.org,2002:str> :key5 =VAL :value4 -MAP -DOC +DOC --- +MAP =VAL :a6 =VAL :1 =VAL &anchor6 :b6 =VAL :2 -MAP -DOC +DOC --- +MAP <tag:yaml.org,2002:map> =VAL &a8 <tag:yaml.org,2002:str> :key8 =VAL :value7 -MAP -DOC +DOC --- +MAP <tag:yaml.org,2002:map> =VAL &a10 <tag:yaml.org,2002:str> :key10 =VAL :value9 -MAP -DOC +DOC --- =VAL &a11 <tag:yaml.org,2002:str> :value11 -DOC -STR
# 9MMW - Spec Example 7.21. Single Pair Implicit Entries [1.3
Tags:
1.3-mod, flow, mapping, spec
Source
Test Results
- [ YAML : separate ]
- [ : empty key entry ]
- [ "JSON like":adjacent ]
+STR +DOC +SEQ +SEQ +MAP =VAL :YAML =VAL :separate -MAP -SEQ +SEQ +MAP =VAL : =VAL :empty key entry -MAP -SEQ +SEQ +MAP =VAL "JSON like =VAL :adjacent -MAP -SEQ -SEQ -DOC -STR
# 9SA2 - Multiline double quoted flow mapping key
Tags:
double, flow, mapping
Source
Test Results
---
- { "single line": value}
- { "multi
  line": value}
[
  {
    "single line": "value"
  },
  {
    "multi line": "value"
  }
]
+STR +DOC --- +SEQ +MAP =VAL "single line =VAL :value -MAP +MAP =VAL "multi line =VAL :value -MAP -SEQ -DOC -STR
# 9SHH - Spec Example 5.8. Quoted Scalar Indicators
Tags:
scalar, spec
Source
Test Results
single: 'text'
double: "text"
{
  "single": "text",
  "double": "text"
}
+STR +DOC +MAP =VAL :single =VAL 'text =VAL :double =VAL "text -MAP -DOC -STR
# 9TFX - Spec Example 7.6. Double Quoted Lines [1.3]
Tags:
1.3-mod, scalar, spec
Source
Test Results
---
" 1st non-empty

 2nd non-empty 
 3rd non-empty "
" 1st non-empty\n2nd non-empty 3rd non-empty "
+STR +DOC --- =VAL " 1st non-empty\n2nd non-empty 3rd non-empty -DOC -STR
# 9U5K - Spec Example 2.12. Compact Nested Mapping
Tags:
mapping, sequence, spec
Source
Test Results
---
# Products purchased
- 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
  }
]
+STR +DOC --- +SEQ +MAP =VAL :item =VAL :Super Hoop =VAL :quantity =VAL :1 -MAP +MAP =VAL :item =VAL :Basketball =VAL :quantity =VAL :4 -MAP +MAP =VAL :item =VAL :Big Shoes =VAL :quantity =VAL :1 -MAP -SEQ -DOC -STR
# 9WXW - Spec Example 6.18. Primary Tag Handle
Tags:
1.3-err, directive, spec, tag
Source
Test Results
# Private
!foo "bar"
...
# Global
%TAG ! tag:example.com,2000:app/
---
!foo "bar"
+STR +DOC =VAL <!foo> "bar -DOC ... +DOC --- =VAL <tag:example.com,2000:app/foo> "bar -DOC -STR
# 9YRD - Multiline Scalar at Top Level
Tags:
1.3-err, scalar
Source
Test Results
a
b  
  c
d

e
"a b c d\ne"
+STR +DOC =VAL :a b c d\ne -DOC -STR
# A2M4 - Spec Example 6.2. Indentation Indicators
Tags:
indent, libyaml-err, sequence, spec, upto-1.2, whitespace
Source
Test Results
? a
: -	b
  -  -	c
     - d
{
  "a": [
    "b",
    [
      "c",
      "d"
    ]
  ]
}
+STR +DOC +MAP =VAL :a +SEQ =VAL :b +SEQ =VAL :c =VAL :d -SEQ -SEQ -MAP -DOC -STR
# A6F9 - Spec Example 8.4. Chomping Final Line Break
Tags:
literal, scalar, spec
Source
Test Results
strip: |-
  text
clip: |
  text
keep: |+
  text
{
  "strip": "text",
  "clip": "text\n",
  "keep": "text\n"
}
+STR +DOC +MAP =VAL :strip =VAL |text =VAL :clip =VAL |text\n =VAL :keep =VAL |text\n -MAP -DOC -STR
# A984 - Multiline Scalar in Mapping
Tags:
scalar
Source
Test Results
a: b
 c
d:
 e
  f
{
  "a": "b c",
  "d": "e f"
}
+STR +DOC +MAP =VAL :a =VAL :b c =VAL :d =VAL :e f -MAP -DOC -STR
# AB8U - Sequence entry that looks like two with wrong indentation
Tags:
sequence
Source
Test Results
- single multiline
 - sequence entry
[
  "single multiline - sequence entry"
]
+STR +DOC +SEQ =VAL :single multiline - sequence entry -SEQ -DOC -STR
# AVM7 - Empty Stream
Tags:
edge
Source
Test Results
+STR -STR
# AZ63 - Sequence With Same Indentation as Parent Mapping
Tags:
mapping, sequence
Source
Test Results
1:
- 2
- 3
4: 5
{
  "1": [
    2,
    3
  ],
  "4": 5
}
+STR +DOC +MAP =VAL :1 +SEQ =VAL :2 =VAL :3 -SEQ =VAL :4 =VAL :5 -MAP -DOC -STR
# AZW3 - Lookahead test cases
Tags:
edge, mapping
Source
Test Results
- bla"keks: foo
- bla]keks: foo
[
  {
    "bla\"keks": "foo"
  },
  {
    "bla]keks": "foo"
  }
]
+STR +DOC +SEQ +MAP =VAL :bla"keks =VAL :foo -MAP +MAP =VAL :bla]keks =VAL :foo -MAP -SEQ -DOC -STR
# B3HG - Spec Example 8.9. Folded Scalar [1.3]
Tags:
1.3-mod, folded, scalar, spec
Source
Test Results
--- >
 folded
 text


"folded text\n"
+STR +DOC --- =VAL >folded text\n -DOC -STR
# BEC7 - Spec Example 6.14. “YAML” directive
Tags:
directive, spec
Source
Test Results
%YAML 1.3 # Attempt parsing
          # with a warning
---
"foo"
"foo"
+STR +DOC --- =VAL "foo -DOC -STR
# BU8L - Node Anchor and Tag on Seperate Lines
Tags:
1.3-err, anchor, indent
Source
Test Results
key: &anchor
 !!map
  a: b
{
  "key": {
    "a": "b"
  }
}
+STR +DOC +MAP =VAL :key +MAP &anchor <tag:yaml.org,2002:map> =VAL :a =VAL :b -MAP -MAP -DOC -STR
# C2DT - Spec Example 7.18. Flow Mapping Adjacent Values
Tags:
flow, mapping, spec
Source
Test Results
{
"adjacent":value,
"readable": value,
"empty":
}
{
  "adjacent": "value",
  "readable": "value",
  "empty": null
}
+STR +DOC +MAP =VAL "adjacent =VAL :value =VAL "readable =VAL :value =VAL "empty =VAL : -MAP -DOC -STR
# C4HZ - Spec Example 2.24. Global Tags
Tags:
alias, directive, spec, tag
Source
Test Results
%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.
+STR +DOC --- +SEQ <tag:clarkevans.com,2002:shape> +MAP <tag:clarkevans.com,2002:circle> =VAL :center +MAP &ORIGIN =VAL :x =VAL :73 =VAL :y =VAL :129 -MAP =VAL :radius =VAL :7 -MAP +MAP <tag:clarkevans.com,2002:line> =VAL :start =ALI *ORIGIN =VAL :finish +MAP =VAL :x =VAL :89 =VAL :y =VAL :102 -MAP -MAP +MAP <tag:clarkevans.com,2002:label> =VAL :start =ALI *ORIGIN =VAL :color =VAL :0xFFEEBB =VAL :text =VAL :Pretty vector drawing. -MAP -SEQ -DOC -STR
# CC74 - Spec Example 6.20. Tag Handles
Tags:
directive, spec, tag
Source
Test Results
%TAG !e! tag:example.com,2000:app/
---
!e!foo "bar"
+STR +DOC --- =VAL <tag:example.com,2000:app/foo> "bar -DOC -STR
# CN3R - Various location of anchors in flow sequence
Tags:
anchor, flow
Source
Test Results
&flowseq [
 a: b,
 &c c: d,
 { &e e: f },
 &g { g: h }
]
[
  {
    "a": "b"
  },
  {
    "c": "d"
  },
  {
    "e": "f"
  },
  {
    "g": "h"
  }
]
+STR +DOC +SEQ &flowseq +MAP =VAL :a =VAL :b -MAP +MAP =VAL &c :c =VAL :d -MAP +MAP =VAL &e :e =VAL :f -MAP +MAP &g =VAL :g =VAL :h -MAP -SEQ -DOC -STR
# CT4Q - Spec Example 7.20. Single Pair Explicit Entry
Tags:
flow, mapping, spec
Source
Test Results
[
? foo
 bar : baz
]
[
  {
    "foo bar": "baz"
  }
]
+STR +DOC +SEQ +MAP =VAL :foo bar =VAL :baz -MAP -SEQ -DOC -STR
# CUP7 - Spec Example 5.6. Node Property Indicators
Tags:
alias, spec, tag
Source
Test Results
anchored: !local &anchor value
alias: *anchor
{
  "anchored": "value",
  "alias": "value"
}
+STR +DOC +MAP =VAL :anchored =VAL &anchor <!local> :value =VAL :alias =ALI *anchor -MAP -DOC -STR
# D83L - Block scalar indicator order
Tags:
literal
Source
Test Results
- |2-
  explicit indent and chomp
- |-2
  chomp and explicit indent
[
  "explicit indent and chomp",
  "chomp and explicit indent"
]
+STR +DOC +SEQ =VAL |explicit indent and chomp =VAL |chomp and explicit indent -SEQ -DOC -STR
# D88J - Flow Sequence in Block Mapping
Tags:
flow, mapping, sequence
Source
Test Results
a: [b, c]
{
  "a": [
    "b",
    "c"
  ]
}
+STR +DOC +MAP =VAL :a +SEQ =VAL :b =VAL :c -SEQ -MAP -DOC -STR
# D9TU - Single Pair Block Mapping
Tags:
mapping, simple
Source
Test Results
foo: bar
{
  "foo": "bar"
}
+STR +DOC +MAP =VAL :foo =VAL :bar -MAP -DOC -STR
# DBG4 - Spec Example 7.10. Plain Characters
Tags:
flow, scalar, sequence, spec
Source
Test Results
# 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 ]
[
  "::vector",
  ": - ()",
  "Up, up, and away!",
  -123,
  "http://example.com/foo#bar",
  [
    "::vector",
    ": - ()",
    "Up, up and away!",
    -123,
    "http://example.com/foo#bar"
  ]
]
+STR +DOC +SEQ =VAL :::vector =VAL ": - () =VAL :Up, up, and away! =VAL :-123 =VAL :http://example.com/foo#bar +SEQ =VAL :::vector =VAL ": - () =VAL "Up, up and away! =VAL :-123 =VAL :http://example.com/foo#bar -SEQ -SEQ -DOC -STR
# DC7X - Various trailing tabs
Tags:
comment, whitespace
Source
Test Results
a: b	
seq:	
 - a	
c: d	#X
{
  "a": "b",
  "seq": [
    "a"
  ],
  "c": "d"
}
+STR +DOC +MAP =VAL :a =VAL :b =VAL :seq +SEQ =VAL :a -SEQ =VAL :c =VAL :d -MAP -DOC -STR
# DFF7 - Spec Example 7.16. Flow Mapping Entries
Tags:
flow, mapping, spec
Source
Test Results
{
? explicit: entry,
implicit: entry,
?
}
+STR +DOC +MAP =VAL :explicit =VAL :entry =VAL :implicit =VAL :entry =VAL : =VAL : -MAP -DOC -STR
# DHP8 - Flow Sequence
Tags:
flow, sequence
Source
Test Results
[foo, bar, 42]
[
  "foo",
  "bar",
  42
]
+STR +DOC +SEQ =VAL :foo =VAL :bar =VAL :42 -SEQ -DOC -STR
# DK3J - Zero indented block scalar with line that looks like a comment
Tags:
comment, folded, scalar
Source
Test Results
--- >
line1
# no comment
line3
"line1 # no comment line3\n"
+STR +DOC --- =VAL >line1 # no comment line3\n -DOC -STR
# DWX9 - Spec Example 8.8. Literal Content
Tags:
1.3-err, comment, literal, scalar, spec
Source
Test Results
|
 
  
  literal
   
  
  text

 # Comment
"\n\nliteral\n \n\ntext\n"
+STR +DOC =VAL |\n\nliteral\n \n\ntext\n -DOC -STR
# E76Z - Aliases in Implicit Block Mapping
Tags:
alias, mapping
Source
Test Results
&a a: &b b
*a : *b
{
  "a": "b"
}
+STR +DOC +MAP =VAL &a :a =VAL &b :b =ALI *a =ALI *b -MAP -DOC -STR
# EHF6 - Tags for Flow Objects
Tags:
flow, tag
Source
Test Results
!!map {
  k: !!seq
  [ a, !!str b]
}
{
  "k": [
    "a",
    "b"
  ]
}
+STR +DOC +MAP <tag:yaml.org,2002:map> =VAL :k +SEQ <tag:yaml.org,2002:seq> =VAL :a =VAL <tag:yaml.org,2002:str> :b -SEQ -MAP -DOC -STR
# EX5H - Multiline Scalar at Top Level [1.3]
Tags:
1.3-mod, scalar
Source
Test Results
---
a
b  
  c
d

e
"a b c d\ne"
+STR +DOC --- =VAL :a b c d\ne -DOC -STR
# EXG3 - Three dashes and content without space [1.3]
Tags:
1.3-mod, scalar
Source
Test Results
---
---word1
word2
"---word1 word2"
+STR +DOC --- =VAL :---word1 word2 -DOC -STR
# F2C7 - Anchors and Tags
Tags:
anchor, tag
Source
Test Results
 - &a !!str a
 - !!int 2
 - !!int &c 4
 - &d d
[
  "a",
  2,
  4,
  "d"
]
+STR +DOC +SEQ =VAL &a <tag:yaml.org,2002:str> :a =VAL <tag:yaml.org,2002:int> :2 =VAL &c <tag:yaml.org,2002:int> :4 =VAL &d :d -SEQ -DOC -STR
# F3CP - Nested flow collections on one line
Tags:
flow, mapping, sequence
Source
Test Results
---
{ a: [b, c, { d: [e, f] } ] }
{
  "a": [
    "b",
    "c",
    {
      "d": [
        "e",
        "f"
      ]
    }
  ]
}
+STR +DOC --- +MAP =VAL :a +SEQ =VAL :b =VAL :c +MAP =VAL :d +SEQ =VAL :e =VAL :f -SEQ -MAP -SEQ -MAP -DOC -STR
# F6MC - More indented lines at the beginning of folded block scalars
Tags:
folded, whitespace
Source
Test Results
---
a: >2
   more indented
  regular
b: >2


   more indented
  regular
{
  "a": " more indented\nregular\n",
  "b": "\n\n more indented\nregular\n"
}
+STR +DOC --- +MAP =VAL :a =VAL > more indented\nregular\n =VAL :b =VAL >\n\n more indented\nregular\n -MAP -DOC -STR
# F8F9 - Spec Example 8.5. Chomping Trailing Lines
Tags:
comment, literal, scalar, spec
Source
Test Results
 # Strip
  # Comments:
strip: |-
  # text
  
 # Clip
  # comments:

clip: |
  # text
 
 # Keep
  # comments:

keep: |+
  # text

 # Trail
  # comments.
{
  "strip": "# text",
  "clip": "# text\n",
  "keep": "# text\n\n"
}
+STR +DOC +MAP =VAL :strip =VAL |# text =VAL :clip =VAL |# text\n =VAL :keep =VAL |# text\n\n -MAP -DOC -STR
# FBC9 - Allowed characters in plain scalars
Tags:
scalar
Source
Test Results
safe: a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~
     !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~
safe question mark: ?foo
safe colon: :foo
safe dash: -foo
{
  "safe": "a!\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~ !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~",
  "safe question mark": "?foo",
  "safe colon": ":foo",
  "safe dash": "-foo"
}
+STR +DOC +MAP =VAL :safe =VAL :a!"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~ !"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~ =VAL :safe question mark =VAL :?foo =VAL :safe colon =VAL ::foo =VAL :safe dash =VAL :-foo -MAP -DOC -STR
# FH7J - Tags on Empty Scalars
Tags:
scalar, tag
Source
Test Results
- !!str
-
  !!null : a
  b: !!str
- !!str : !!null
+STR +DOC +SEQ =VAL <tag:yaml.org,2002:str> : +MAP =VAL <tag:yaml.org,2002:null> : =VAL :a =VAL :b =VAL <tag:yaml.org,2002:str> : -MAP +MAP =VAL <tag:yaml.org,2002:str> : =VAL <tag:yaml.org,2002:null> : -MAP -SEQ -DOC -STR
# FP8R - Zero indented block scalar
Tags:
folded, indent, scalar
Source
Test Results
--- >
line1
line2
line3
"line1 line2 line3\n"
+STR +DOC --- =VAL >line1 line2 line3\n -DOC -STR
# FQ7F - Spec Example 2.1. Sequence of Scalars
Tags:
sequence, spec
Source
Test Results
- Mark McGwire
- Sammy Sosa
- Ken Griffey
[
  "Mark McGwire",
  "Sammy Sosa",
  "Ken Griffey"
]
+STR +DOC +SEQ =VAL :Mark McGwire =VAL :Sammy Sosa =VAL :Ken Griffey -SEQ -DOC -STR
# FRK4 - Spec Example 7.3. Completely Empty Flow Nodes
Tags:
flow, scalar, spec
Source
Test Results
{
  ? foo :,
  : bar,
}
+STR +DOC +MAP =VAL :foo =VAL : =VAL : =VAL :bar -MAP -DOC -STR
# FTA2 - Single block sequence with anchor and explicit document start
Tags:
anchor, header, sequence
Source
Test Results
--- &sequence
- a
[
  "a"
]
+STR +DOC --- +SEQ &sequence =VAL :a -SEQ -DOC -STR
# FUP4 - Flow Sequence in Flow Sequence
Tags:
flow, sequence
Source
Test Results
[a, [b, c]]
[
  "a",
  [
    "b",
    "c"
  ]
]
+STR +DOC +SEQ =VAL :a +SEQ =VAL :b =VAL :c -SEQ -SEQ -DOC -STR
# G4RS - Spec Example 2.17. Quoted Scalars
Tags:
scalar, spec
Source
Test Results
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: '|\-*-/|'
{
  "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": "|\\-*-/|"
}
+STR +DOC +MAP =VAL :unicode =VAL "Sosa did fine.☺ =VAL :control =VAL "\b1998\t1999\t2000\n =VAL :hex esc =VAL "\r\n is \r\n =VAL :single =VAL '"Howdy!" he cried. =VAL :quoted =VAL ' # Not a 'comment'. =VAL :tie-fighter =VAL '|\\-*-/| -MAP -DOC -STR
# G992 - Spec Example 8.9. Folded Scalar
Tags:
1.3-err, folded, scalar, spec
Source
Test Results
>
 folded
 text


"folded text\n"
+STR +DOC =VAL >folded text\n -DOC -STR
# GH63 - Mixed Block Mapping (explicit to implicit)
Tags:
mapping
Source
Test Results
? a
: 13
1.5: d
{
  "a": 13,
  "1.5": "d"
}
+STR +DOC +MAP =VAL :a =VAL :13 =VAL :1.5 =VAL :d -MAP -DOC -STR
# H2RW - Blank lines
Tags:
comment, scalar
Source
Test Results
foo: 1

bar: 2
    
text: |
  a
    
  b

  c
 
  d
{
  "foo": 1,
  "bar": 2,
  "text": "a\n  \nb\n\nc\n\nd\n"
}
+STR +DOC +MAP =VAL :foo =VAL :1 =VAL :bar =VAL :2 =VAL :text =VAL |a\n \nb\n\nc\n\nd\n -MAP -DOC -STR
# H3Z8 - Literal unicode
Tags:
mapping
Source
Test Results
---
wanted: love ♥ and peace ☮
{
  "wanted": "love ♥ and peace ☮"
}
+STR +DOC --- +MAP =VAL :wanted =VAL :love ♥ and peace ☮ -MAP -DOC -STR
# HMK4 - Spec Example 2.16. Indentation determines scope
Tags:
folded, literal, spec
Source
Test Results
name: Mark McGwire
accomplishment: >
  Mark set a major league
  home run record in 1998.
stats: |
  65 Home Runs
  0.278 Batting Average
{
  "name": "Mark McGwire",
  "accomplishment": "Mark set a major league home run record in 1998.\n",
  "stats": "65 Home Runs\n0.278 Batting Average\n"
}
+STR +DOC +MAP =VAL :name =VAL :Mark McGwire =VAL :accomplishment =VAL >Mark set a major league home run record in 1998.\n =VAL :stats =VAL |65 Home Runs\n0.278 Batting Average\n -MAP -DOC -STR
# HMQ5 - Spec Example 6.23. Node Properties
Tags:
alias, spec, tag
Source
Test Results
!!str &a1 "foo":
  !!str bar
&a2 baz : *a1
{
  "foo": "bar",
  "baz": "foo"
}
+STR +DOC +MAP =VAL &a1 <tag:yaml.org,2002:str> "foo =VAL <tag:yaml.org,2002:str> :bar =VAL &a2 :baz =ALI *a1 -MAP -DOC -STR
# HS5T - Spec Example 7.12. Plain Lines
Tags:
scalar, spec, upto-1.2
Source
Test Results
1st non-empty

 2nd non-empty 
	3rd non-empty
"1st non-empty\n2nd non-empty 3rd non-empty"
+STR +DOC =VAL :1st non-empty\n2nd non-empty 3rd non-empty -DOC -STR
# HWV9 - Document-end marker
Tags:
footer
Source
Test Results
...
+STR -STR
# J3BT - Spec Example 5.12. Tabs and Spaces
Tags:
spec, upto-1.2, whitespace
Source
Test Results
# Tabs and spaces
quoted: "Quoted 	"
block:	|
  void main() {
  	printf("Hello, world!\n");
  }
{
  "quoted": "Quoted \t",
  "block": "void main() {\n\tprintf(\"Hello, world!\\n\");\n}\n"
}
+STR +DOC +MAP =VAL :quoted =VAL "Quoted \t =VAL :block =VAL |void main() {\n\tprintf("Hello, world!\\n");\n}\n -MAP -DOC -STR
# J5UC - Multiple Pair Block Mapping
Tags:
mapping
Source
Test Results
foo: blue
bar: arrr
baz: jazz
{
  "foo": "blue",
  "bar": "arrr",
  "baz": "jazz"
}
+STR +DOC +MAP =VAL :foo =VAL :blue =VAL :bar =VAL :arrr =VAL :baz =VAL :jazz -MAP -DOC -STR
# J7PZ - Spec Example 2.26. Ordered Mappings
Tags:
mapping, spec
Source
Test Results
# 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
[
  {
    "Mark McGwire": 65
  },
  {
    "Sammy Sosa": 63
  },
  {
    "Ken Griffy": 58
  }
]
+STR +DOC --- +SEQ <tag:yaml.org,2002:omap> +MAP =VAL :Mark McGwire =VAL :65 -MAP +MAP =VAL :Sammy Sosa =VAL :63 -MAP +MAP =VAL :Ken Griffy =VAL :58 -MAP -SEQ -DOC -STR
# J7VC - Empty Lines Between Mapping Elements
Tags:
mapping, whitespace
Source
Test Results
1: 2


3: 4
{
  "1": 2,
  "3": 4
}
+STR +DOC +MAP =VAL :1 =VAL :2 =VAL :3 =VAL :4 -MAP -DOC -STR
# J9HZ - Spec Example 2.9. Single Document with Two Comments
Tags:
comment, spec
Source
Test Results
---
hr: # 1998 hr ranking
  - Mark McGwire
  - Sammy Sosa
rbi:
  # 1998 rbi ranking
  - Sammy Sosa
  - Ken Griffey
{
  "hr": [
    "Mark McGwire",
    "Sammy Sosa"
  ],
  "rbi": [
    "Sammy Sosa",
    "Ken Griffey"
  ]
}
+STR +DOC --- +MAP =VAL :hr +SEQ =VAL :Mark McGwire =VAL :Sammy Sosa -SEQ =VAL :rbi +SEQ =VAL :Sammy Sosa =VAL :Ken Griffey -SEQ -MAP -DOC -STR
# JDH8 - Plain Scalar looking like key, comment, anchor and tag [1.3]
Tags:
1.3-mod, scalar
Source
Test Results
---
k:#foo
 &a !t s
"k:#foo &a !t s"
+STR +DOC --- =VAL :k:#foo &a !t s -DOC -STR
# JHB9 - Spec Example 2.7. Two Documents in a Stream
Tags:
header, spec
Source
Test Results
# Ranking of 1998 home runs
---
- Mark McGwire
- Sammy Sosa
- Ken Griffey

# Team ranking
---
- Chicago Cubs
- St Louis Cardinals
[
  "Mark McGwire",
  "Sammy Sosa",
  "Ken Griffey"
]
[
  "Chicago Cubs",
  "St Louis Cardinals"
]
+STR +DOC --- +SEQ =VAL :Mark McGwire =VAL :Sammy Sosa =VAL :Ken Griffey -SEQ -DOC +DOC --- +SEQ =VAL :Chicago Cubs =VAL :St Louis Cardinals -SEQ -DOC -STR
# JQ4R - Spec Example 8.14. Block Sequence
Tags:
sequence, spec
Source
Test Results
block sequence:
  - one
  - two : three
{
  "block sequence": [
    "one",
    {
      "two": "three"
    }
  ]
}
+STR +DOC +MAP =VAL :block sequence +SEQ =VAL :one +MAP =VAL :two =VAL :three -MAP -SEQ -MAP -DOC -STR
# JS2J - Spec Example 6.29. Node Anchors
Tags:
alias, spec
Source
Test Results
First occurrence: &anchor Value
Second occurrence: *anchor
{
  "First occurrence": "Value",
  "Second occurrence": "Value"
}
+STR +DOC +MAP =VAL :First occurrence =VAL &anchor :Value =VAL :Second occurrence =ALI *anchor -MAP -DOC -STR
# JTV5 - Block Mapping with Multiline Scalars
Tags:
mapping, scalar
Source
Test Results
? a
  true
: null
  d
? e
  42
{
  "a true": "null d",
  "e 42": null
}
+STR +DOC +MAP =VAL :a true =VAL :null d =VAL :e 42 =VAL : -MAP -DOC -STR
# K3WX - Colon and adjacent value after comment on next line
Tags:
tag, words
Source
Test Results
---
{ "foo" # comment
  :bar }
{
  "foo": "bar"
}
+STR +DOC --- +MAP =VAL "foo =VAL :bar -MAP -DOC -STR
# K4SU - Multiple Entry Block Sequence
Tags:
sequence
Source
Test Results
- foo
- bar
- 42
[
  "foo",
  "bar",
  42
]
+STR +DOC +SEQ =VAL :foo =VAL :bar =VAL :42 -SEQ -DOC -STR
# K527 - Spec Example 6.6. Line Folding
Tags:
1.3-err, scalar, spec, whitespace
Source
Test Results
>-
  trimmed
  
 

  as
  space
"trimmed\n\n\nas space"
+STR +DOC =VAL >trimmed\n\n\nas space -DOC -STR
# K54U - Tab after document header
Tags:
header, whitespace
Source
Test Results
---	scalar
"scalar"
+STR +DOC --- =VAL :scalar -DOC -STR
# K858 - Spec Example 8.6. Empty Scalar Chomping
Tags:
folded, literal, spec, whitespace
Source
Test Results
strip: >-

clip: >

keep: |+

{
  "strip": "",
  "clip": "",
  "keep": "\n"
}
+STR +DOC +MAP =VAL :strip =VAL > =VAL :clip =VAL > =VAL :keep =VAL |\n -MAP -DOC -STR
# KK5P - Various combinations of explicit block mappings
Tags:
mapping, sequence
Source
Test Results
complex1:
  ? - a
complex2:
  ? - a
  : b
complex3:
  ? - a
  : >
    b
complex4:
  ? >
    a
  :
complex5:
  ? - a
  : - b
+STR +DOC +MAP =VAL :complex1 +MAP +SEQ =VAL :a -SEQ =VAL : -MAP =VAL :complex2 +MAP +SEQ =VAL :a -SEQ =VAL :b -MAP =VAL :complex3 +MAP +SEQ =VAL :a -SEQ =VAL >b\n -MAP =VAL :complex4 +MAP =VAL >a\n =VAL : -MAP =VAL :complex5 +MAP +SEQ =VAL :a -SEQ +SEQ =VAL :b -SEQ -MAP -MAP -DOC -STR
# KMK3 - Block Submapping
Tags:
mapping
Source
Test Results
foo:
  bar: 1
baz: 2
{
  "foo": {
    "bar": 1
  },
  "baz": 2
}
+STR +DOC +MAP =VAL :foo +MAP =VAL :bar =VAL :1 -MAP =VAL :baz =VAL :2 -MAP -DOC -STR
# KSS4 - Scalars on --- line
Tags:
1.3-err, anchor, header, scalar
Source
Test Results
--- "quoted
string"
--- &node foo
"quoted string"
"foo"
+STR +DOC --- =VAL "quoted string -DOC +DOC --- =VAL &node :foo -DOC -STR
# KZN9 - Spec Example 7.21. Single Pair Implicit Entries
Tags:
1.3-err, flow, mapping, spec
Source
Test Results
- [ YAML : separate ]
- [ : empty key entry ]
- [ {JSON: like}:adjacent ]
+STR +DOC +SEQ +SEQ +MAP =VAL :YAML =VAL :separate -MAP -SEQ +SEQ +MAP =VAL : =VAL :empty key entry -MAP -SEQ +SEQ +MAP +MAP =VAL :JSON =VAL :like -MAP =VAL :adjacent -MAP -SEQ -SEQ -DOC -STR
# L94M - Tags in Explicit Mapping
Tags:
mapping, tag
Source
Test Results
? !!str a
: !!int 47
? c
: !!str d
{
  "a": 47,
  "c": "d"
}
+STR +DOC +MAP =VAL <tag:yaml.org,2002:str> :a =VAL <tag:yaml.org,2002:int> :47 =VAL :c =VAL <tag:yaml.org,2002:str> :d -MAP -DOC -STR
# L9U5 - Spec Example 7.11. Plain Implicit Keys
Tags:
flow, mapping, spec
Source
Test Results
implicit block key : [
  implicit flow key : value,
 ]
{
  "implicit block key": [
    {
      "implicit flow key": "value"
    }
  ]
}
+STR +DOC +MAP =VAL :implicit block key +SEQ +MAP =VAL :implicit flow key =VAL :value -MAP -SEQ -MAP -DOC -STR
# LE5A - Spec Example 7.24. Flow Nodes
Tags:
alias, flow, spec, tag
Source
Test Results
- !!str "a"
- 'b'
- &anchor "c"
- *anchor
- !!str
[
  "a",
  "b",
  "c",
  "c",
  ""
]
+STR +DOC +SEQ =VAL <tag:yaml.org,2002:str> "a =VAL 'b =VAL &anchor "c =ALI *anchor =VAL <tag:yaml.org,2002:str> : -SEQ -DOC -STR
# LP6E - Whitespace After Scalars in Flow
Tags:
flow, scalar, whitespace
Source
Test Results
- [a, b , c ]
- { "a"  : b
   , c : 'd' ,
   e   : "f"
  }
- [      ]
[
  [
    "a",
    "b",
    "c"
  ],
  {
    "a": "b",
    "c": "d",
    "e": "f"
  },
  []
]
+STR +DOC +SEQ +SEQ =VAL :a =VAL :b =VAL :c -SEQ +MAP =VAL "a =VAL :b =VAL :c =VAL 'd =VAL :e =VAL "f -MAP +SEQ -SEQ -SEQ -DOC -STR
# LQZ7 - Spec Example 7.4. Double Quoted Implicit Keys
Tags:
flow, scalar, spec
Source
Test Results
"implicit block key" : [
  "implicit flow key" : value,
 ]
{
  "implicit block key": [
    {
      "implicit flow key": "value"
    }
  ]
}
+STR +DOC +MAP =VAL "implicit block key +SEQ +MAP =VAL "implicit flow key =VAL :value -MAP -SEQ -MAP -DOC -STR
# LX3P - Implicit Flow Mapping Key on one line
Tags:
1.3-err, flow, mapping, sequence
Source
Test Results
[flow]: block
+STR +DOC +MAP +SEQ =VAL :flow -SEQ =VAL :block -MAP -DOC -STR
# M29M - Literal Block Scalar
Tags:
scalar
Source
Test Results
a: |
 ab
 
 cd
 ef
 

...
{
  "a": "ab\n\ncd\nef\n"
}
+STR +DOC +MAP =VAL :a =VAL |ab\n\ncd\nef\n -MAP -DOC ... -STR
# M5C3 - Spec Example 8.21. Block Scalar Nodes
Tags:
1.3-err, folded, literal, spec
Source
Test Results
literal: |2
  value
folded:
   !foo
  >1
 value
{
  "literal": "value\n",
  "folded": "value\n"
}
+STR +DOC +MAP =VAL :literal =VAL |value\n =VAL :folded =VAL <!foo> >value\n -MAP -DOC -STR
# M5DY - Spec Example 2.11. Mapping between Sequences
Tags:
mapping, sequence, spec
Source
Test Results
? - Detroit Tigers
  - Chicago cubs
:
  - 2001-07-23

? [ New York Yankees,
    Atlanta Braves ]
: [ 2001-07-02, 2001-08-12,
    2001-08-14 ]
+STR +DOC +MAP +SEQ =VAL :Detroit Tigers =VAL :Chicago cubs -SEQ +SEQ =VAL :2001-07-23 -SEQ +SEQ =VAL :New York Yankees =VAL :Atlanta Braves -SEQ +SEQ =VAL :2001-07-02 =VAL :2001-08-12 =VAL :2001-08-14 -SEQ -MAP -DOC -STR
# M7A3 - Spec Example 9.3. Bare Documents
Tags:
1.3-err, footer, spec
Source
Test Results
Bare
document
...
# No document
...
|
%!PS-Adobe-2.0 # Not the first line
"Bare document"
"%!PS-Adobe-2.0 # Not the first line\n"
+STR +DOC =VAL :Bare document -DOC ... +DOC =VAL |%!PS-Adobe-2.0 # Not the first line\n -DOC -STR
# M7NX - Nested flow collections
Tags:
flow, mapping, sequence
Source
Test Results
---
{
 a: [
  b, c, {
   d: [e, f]
  }
 ]
}
{
  "a": [
    "b",
    "c",
    {
      "d": [
        "e",
        "f"
      ]
    }
  ]
}
+STR +DOC --- +MAP =VAL :a +SEQ =VAL :b =VAL :c +MAP =VAL :d +SEQ =VAL :e =VAL :f -SEQ -MAP -SEQ -MAP -DOC -STR
# M9B4 - Spec Example 8.7. Literal Scalar
Tags:
1.3-err, literal, scalar, spec
Source
Test Results
|
 literal
 	text


"literal\n\ttext\n"
+STR +DOC =VAL |literal\n\ttext\n -DOC -STR
# MJS9 - Spec Example 6.7. Block Folding
Tags:
1.3-err, scalar, spec, whitespace
Source
Test Results
>
  foo 
 
  	 bar

  baz
"foo \n\n\t bar\n\nbaz\n"
+STR +DOC =VAL >foo \n\n\t bar\n\nbaz\n -DOC -STR
# MXS3 - Flow Mapping in Block Sequence
Tags:
flow, mapping, sequence
Source
Test Results
- {a: b}
[
  {
    "a": "b"
  }
]
+STR +DOC +SEQ +MAP =VAL :a =VAL :b -MAP -SEQ -DOC -STR
# MYW6 - Block Scalar Strip
Tags:
1.3-err, scalar
Source
Test Results
|-
 ab
 
 
...
"ab"
+STR +DOC =VAL |ab -DOC ... -STR
# MZX3 - Non-Specific Tags on Scalars
Tags:
scalar, tag
Source
Test Results
- plain
- "double quoted"
- 'single quoted'
- >
  block
- plain again
[
  "plain",
  "double quoted",
  "single quoted",
  "block\n",
  "plain again"
]
+STR +DOC +SEQ =VAL :plain =VAL "double quoted =VAL 'single quoted =VAL >block\n =VAL :plain again -SEQ -DOC -STR
# NAT4 - Various empty or newline only quoted strings
Tags:
double, scalar, single, whitespace
Source
Test Results
---
a: '
  '
b: '  
  '
c: "
  "
d: "  
  "
e: '

  '
f: "

  "
g: '


  '
h: "


  "
{
  "a": " ",
  "b": " ",
  "c": " ",
  "d": " ",
  "e": "\n",
  "f": "\n",
  "g": "\n\n",
  "h": "\n\n"
}
+STR +DOC --- +MAP =VAL :a =VAL ' =VAL :b =VAL ' =VAL :c =VAL " =VAL :d =VAL " =VAL :e =VAL '\n =VAL :f =VAL "\n =VAL :g =VAL '\n\n =VAL :h =VAL "\n\n -MAP -DOC -STR
# NB6Z - Multiline plain value with tabs on empty lines
Tags:
scalar, whitespace
Source
Test Results
key:
  value
  with
  	
  tabs
{
  "key": "value with\ntabs"
}
+STR +DOC +MAP =VAL :key =VAL :value with\ntabs -MAP -DOC -STR
# NHX8 - Empty Lines at End of Document
Tags:
whitespace
Source
Test Results
:



{
  "": null
}
+STR +DOC +MAP =VAL : =VAL : -MAP -DOC -STR
# NJ66 - Multiline plain flow mapping key
Tags:
flow, mapping
Source
Test Results
---
- { single line: value}
- { multi
  line: value}
[
  {
    "single line": "value"
  },
  {
    "multi line": "value"
  }
]
+STR +DOC --- +SEQ +MAP =VAL :single line =VAL :value -MAP +MAP =VAL :multi line =VAL :value -MAP -SEQ -DOC -STR
# NP9H - Spec Example 7.5. Double Quoted Line Breaks
Tags:
scalar, spec, upto-1.2
Source
Test Results
"folded 
to a space,	
 
to a line feed, or 	\
 \ 	non-content"
"folded to a space,\nto a line feed, or \t \tnon-content"
+STR +DOC =VAL "folded to a space,\nto a line feed, or \t \tnon-content -DOC -STR
# P2AD - Spec Example 8.1. Block Scalar Header
Tags:
comment, folded, literal, scalar, spec
Source
Test Results
- | # Empty header↓
 literal
- >1 # Indentation indicator↓
  folded
- |+ # Chomping indicator↓
 keep

- >1- # Both indicators↓
  strip
[
  "literal\n",
  " folded\n",
  "keep\n\n",
  " strip"
]
+STR +DOC +SEQ =VAL |literal\n =VAL > folded\n =VAL |keep\n\n =VAL > strip -SEQ -DOC -STR
# P76L - Spec Example 6.19. Secondary Tag Handle
Tags:
header, spec, tag
Source
Test Results
%TAG !! tag:example.com,2000:app/
---
!!int 1 - 3 # Interval, not integer
+STR +DOC --- =VAL <tag:example.com,2000:app/int> :1 - 3 -DOC -STR
# P94K - Spec Example 6.11. Multi-Line Comments
Tags:
comment, spec
Source
Test Results
key:    # Comment
        # lines
  value


{
  "key": "value"
}
+STR +DOC +MAP =VAL :key =VAL :value -MAP -DOC -STR
# PBJ2 - Spec Example 2.3. Mapping Scalars to Sequences
Tags:
mapping, sequence, spec
Source
Test Results
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"
  ]
}
+STR +DOC +MAP =VAL :american +SEQ =VAL :Boston Red Sox =VAL :Detroit Tigers =VAL :New York Yankees -SEQ =VAL :national +SEQ =VAL :New York Mets =VAL :Chicago Cubs =VAL :Atlanta Braves -SEQ -MAP -DOC -STR
# PRH3 - Spec Example 7.9. Single Quoted Lines
Tags:
scalar, spec, upto-1.2
Source
Test Results
' 1st non-empty

 2nd non-empty 
	3rd non-empty '
" 1st non-empty\n2nd non-empty 3rd non-empty "
+STR +DOC =VAL ' 1st non-empty\n2nd non-empty 3rd non-empty -DOC -STR
# PUW8 - Document start on last line
Tags:
header
Source
Test Results
---
a: b
---
{
  "a": "b"
}
null
+STR +DOC --- +MAP =VAL :a =VAL :b -MAP -DOC +DOC --- =VAL : -DOC -STR
# PW8X - Anchors on Empty Scalars
Tags:
anchor, empty, missing
Source
Test Results
- &a
- a
-
  &a : a
  b: &b
-
  &c : &a
-
  ? &d
-
  ? &e
  : &a
+STR +DOC +SEQ =VAL &a : =VAL :a +MAP =VAL &a : =VAL :a =VAL :b =VAL &b : -MAP +MAP =VAL &c : =VAL &a : -MAP +MAP =VAL &d : =VAL : -MAP +MAP =VAL &e : =VAL &a : -MAP -SEQ -DOC -STR
# Q5MG - Tab at beginning of line followed by a flow mapping
Tags:
flow, whitespace
Source
Test Results
	{}
{}
+STR +DOC +MAP -MAP -DOC -STR
# Q88A - Spec Example 7.23. Flow Content
Tags:
flow, mapping, sequence, spec
Source
Test Results
- [ a, b ]
- { a: b }
- "a"
- 'b'
- c
[
  [
    "a",
    "b"
  ],
  {
    "a": "b"
  },
  "a",
  "b",
  "c"
]
+STR +DOC +SEQ +SEQ =VAL :a =VAL :b -SEQ +MAP =VAL :a =VAL :b -MAP =VAL "a =VAL 'b =VAL :c -SEQ -DOC -STR
# Q8AD - Spec Example 7.5. Double Quoted Line Breaks [1.3]
Tags:
1.3-mod, scalar, spec
Source
Test Results
---
"folded 
to a space,
 
to a line feed, or 	\
 \ 	non-content"
"folded to a space,\nto a line feed, or \t \tnon-content"
+STR +DOC --- =VAL "folded to a space,\nto a line feed, or \t \tnon-content -DOC -STR
# Q9WF - Spec Example 6.12. Separation Spaces
Tags:
1.3-err, comment, spec, whitespace
Source
Test Results
{ first: Sammy, last: Sosa }:
# Statistics:
  hr:  # Home runs
     65
  avg: # Average
   0.278
+STR +DOC +MAP +MAP =VAL :first =VAL :Sammy =VAL :last =VAL :Sosa -MAP +MAP =VAL :hr =VAL :65 =VAL :avg =VAL :0.278 -MAP -MAP -DOC -STR
# QF4Y - Spec Example 7.19. Single Pair Flow Mappings
Tags:
flow, mapping, spec
Source
Test Results
[
foo: bar
]
[
  {
    "foo": "bar"
  }
]
+STR +DOC +SEQ +MAP =VAL :foo =VAL :bar -MAP -SEQ -DOC -STR
# QT73 - Comment and document-end marker
Tags:
comment, footer
Source
Test Results
# comment
...
+STR -STR
# R4YG - Spec Example 8.2. Block Indentation Indicator
Tags:
folded, libyaml-err, literal, scalar, spec, upto-1.2
Source
Test Results
- |
 detected
- >
 
  
  # detected
- |1
  explicit
- >
 	
 detected
[
  "detected\n",
  "\n\n# detected\n",
  " explicit\n",
  "\t\ndetected\n"
]
+STR +DOC +SEQ =VAL |detected\n =VAL >\n\n# detected\n =VAL | explicit\n =VAL >\t\ndetected\n -SEQ -DOC -STR
# R52L - Nested flow mapping sequence and mappings
Tags:
flow, mapping, sequence
Source
Test Results
---
{ top1: [item1, {key2: value2}, item3], top2: value2 }
{
  "top1": [
    "item1",
    {
      "key2": "value2"
    },
    "item3"
  ],
  "top2": "value2"
}
+STR +DOC --- +MAP =VAL :top1 +SEQ =VAL :item1 +MAP =VAL :key2 =VAL :value2 -MAP =VAL :item3 -SEQ =VAL :top2 =VAL :value2 -MAP -DOC -STR
# RLU9 - Sequence Indent
Tags:
indent, sequence
Source
Test Results
foo:
- 42
bar:
  - 44
{
  "foo": [
    42
  ],
  "bar": [
    44
  ]
}
+STR +DOC +MAP =VAL :foo +SEQ =VAL :42 -SEQ =VAL :bar +SEQ =VAL :44 -SEQ -MAP -DOC -STR
# RR7F - Mixed Block Mapping (implicit to explicit)
Tags:
mapping
Source
Test Results
a: 4.2
? 23
: d
{
  "23": "d",
  "a": 4.2
}
+STR +DOC +MAP =VAL :a =VAL :4.2 =VAL :23 =VAL :d -MAP -DOC -STR
# RTP8 - Spec Example 9.2. Document Markers
Tags:
footer, header, spec
Source
Test Results
%YAML 1.2
---
Document
... # Suffix
"Document"
+STR +DOC --- =VAL :Document -DOC ... -STR
# RZP5 - Various Trailing Comments [1.3]
Tags:
1.3-mod, comment
Source
Test Results
a: "double
  quotes" # lala
b: plain
 value  # lala
c  : #lala
  d
? # lala
 - seq1
: # lala
 - #lala
  seq2
e: &node # lala
 - x: y
block: > # lala
  abcde
+STR +DOC +MAP =VAL :a =VAL "double quotes =VAL :b =VAL :plain value =VAL :c =VAL :d +SEQ =VAL :seq1 -SEQ +SEQ =VAL :seq2 -SEQ =VAL :e +SEQ &node +MAP =VAL :x =VAL :y -MAP -SEQ =VAL :block =VAL >abcde\n -MAP -DOC -STR
# RZT7 - Spec Example 2.28. Log File
Tags:
header, literal, mapping, sequence, spec
Source
Test Results
---
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
{
  "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\")\n"
    },
    {
      "file": "MoreClass.py",
      "line": 58,
      "code": "foo = bar"
    }
  ]
}
+STR +DOC --- +MAP =VAL :Time =VAL :2001-11-23 15:01:42 -5 =VAL :User =VAL :ed =VAL :Warning =VAL :This is an error message for the log file -MAP -DOC +DOC --- +MAP =VAL :Time =VAL :2001-11-23 15:02:31 -5 =VAL :User =VAL :ed =VAL :Warning =VAL :A slightly different error message. -MAP -DOC +DOC --- +MAP =VAL :Date =VAL :2001-11-23 15:03:17 -5 =VAL :User =VAL :ed =VAL :Fatal =VAL :Unknown variable "bar" =VAL :Stack +SEQ +MAP =VAL :file =VAL :TopClass.py =VAL :line =VAL :23 =VAL :code =VAL |x = MoreObject("345\\n")\n -MAP +MAP =VAL :file =VAL :MoreClass.py =VAL :line =VAL :58 =VAL :code =VAL |foo = bar -MAP -SEQ -MAP -DOC -STR
# S3PD - Spec Example 8.18. Implicit Block Mapping Entries
Tags:
mapping, spec
Source
Test Results
plain key: in-line value
: # Both empty
"quoted key":
- entry
{
  "plain key": "in-line value",
  "": null,
  "quoted key": [
    "entry"
  ]
}
+STR +DOC +MAP =VAL :plain key =VAL :in-line value =VAL : =VAL : =VAL "quoted key +SEQ =VAL :entry -SEQ -MAP -DOC -STR
# S4JQ - Spec Example 6.28. Non-Specific Tags
Tags:
spec, tag
Source
Test Results
# Assuming conventional resolution:
- "12"
- 12
- ! 12
[
  "12",
  12,
  "12"
]
+STR +DOC +SEQ =VAL "12 =VAL :12 =VAL <!> :12 -SEQ -DOC -STR
# S4T7 - Document with footer
Tags:
footer, mapping
Source
Test Results
aaa: bbb
...
{
  "aaa": "bbb"
}
+STR +DOC +MAP =VAL :aaa =VAL :bbb -MAP -DOC ... -STR
# S98Z - Block scalar with spaces only
Tags:
comment, folded, scalar, whitespace
Source
Test Results
empty block scalar: >
 
  
   
 # comment
{
  "empty block scalar": ""
}
+STR +DOC +MAP =VAL :empty block scalar =VAL > -MAP -DOC -STR
# S9E8 - Spec Example 5.3. Block Structure Indicators
Tags:
mapping, sequence, spec
Source
Test Results
sequence:
- one
- two
mapping:
  ? sky
  : blue
  sea : green
{
  "sequence": [
    "one",
    "two"
  ],
  "mapping": {
    "sky": "blue",
    "sea": "green"
  }
}
+STR +DOC +MAP =VAL :sequence +SEQ =VAL :one =VAL :two -SEQ =VAL :mapping +MAP =VAL :sky =VAL :blue =VAL :sea =VAL :green -MAP -MAP -DOC -STR
# SBG9 - Flow Sequence in Flow Mapping
Tags:
flow, mapping, sequence
Source
Test Results
{a: [b, c], [d, e]: f}
+STR +DOC +MAP =VAL :a +SEQ =VAL :b =VAL :c -SEQ +SEQ =VAL :d =VAL :e -SEQ =VAL :f -MAP -DOC -STR
# SKE5 - Anchor before zero indented sequence
Tags:
anchor, sequence
Source
Test Results
---
seq:
 &anchor
- a
- b
{
  "seq": [
    "a",
    "b"
  ]
}
+STR +DOC --- +MAP =VAL :seq +SEQ &anchor =VAL :a =VAL :b -SEQ -MAP -DOC -STR
# SSW6 - Spec Example 7.7. Single Quoted Characters [1.3]
Tags:
1.3-mod, scalar, spec
Source
Test Results
---
'here''s to "quotes"'
"here's to \"quotes\""
+STR +DOC --- =VAL 'here's to "quotes" -DOC -STR
# SYW4 - Spec Example 2.2. Mapping Scalars to Scalars
Tags:
comment, literal, scalar, spec
Source
Test Results
hr:  65    # Home runs
avg: 0.278 # Batting average
rbi: 147   # Runs Batted In
{
  "hr": 65,
  "avg": 0.278,
  "rbi": 147
}
+STR +DOC +MAP =VAL :hr =VAL :65 =VAL :avg =VAL :0.278 =VAL :rbi =VAL :147 -MAP -DOC -STR
# T26H - Spec Example 8.8. Literal Content [1.3]
Tags:
1.3-mod, comment, literal, scalar, spec
Source
Test Results
--- |
 
  
  literal
   
  
  text

 # Comment
"\n\nliteral\n \n\ntext\n"
+STR +DOC --- =VAL |\n\nliteral\n \n\ntext\n -DOC -STR
# T4YY - Spec Example 7.9. Single Quoted Lines [1.3]
Tags:
1.3-mod, scalar, spec
Source
Test Results
---
' 1st non-empty

 2nd non-empty 
 3rd non-empty '
" 1st non-empty\n2nd non-empty 3rd non-empty "
+STR +DOC --- =VAL ' 1st non-empty\n2nd non-empty 3rd non-empty -DOC -STR
# T5N4 - Spec Example 8.7. Literal Scalar [1.3]
Tags:
1.3-mod, literal, scalar, spec
Source
Test Results
--- |
 literal
 	text


"literal\n\ttext\n"
+STR +DOC --- =VAL |literal\n\ttext\n -DOC -STR
# TE2A - Spec Example 8.16. Block Mappings
Tags:
mapping, spec
Source
Test Results
block mapping:
 key: value
{
  "block mapping": {
    "key": "value"
  }
}
+STR +DOC +MAP =VAL :block mapping +MAP =VAL :key =VAL :value -MAP -MAP -DOC -STR
# TL85 - Spec Example 6.8. Flow Folding
Tags:
scalar, spec, upto-1.2, whitespace
Source
Test Results
"
  foo 
 
  	 bar

  baz
"
" foo\nbar\nbaz "
+STR +DOC =VAL " foo\nbar\nbaz -DOC -STR
# TS54 - Folded Block Scalar
Tags:
1.3-err, scalar
Source
Test Results
>
 ab
 cd
 
 ef


 gh
"ab cd\nef\n\ngh\n"
+STR +DOC =VAL >ab cd\nef\n\ngh\n -DOC -STR
# U3C3 - Spec Example 6.16. “TAG” directive
Tags:
header, spec, tag
Source
Test Results
%TAG !yaml! tag:yaml.org,2002:
---
!yaml!str "foo"
"foo"
+STR +DOC --- =VAL <tag:yaml.org,2002:str> "foo -DOC -STR
# U3XV - Node and Mapping Key Anchors
Tags:
1.3-err, anchor, comment
Source
Test Results
---
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
{
  "top1": {
    "key1": "one"
  },
  "top2": {
    "key2": "two"
  },
  "top3": {
    "key3": "three"
  },
  "top4": {
    "key4": "four"
  },
  "top5": {
    "key5": "five"
  },
  "top6": "six",
  "top7": "seven"
}
+STR +DOC --- +MAP =VAL :top1 +MAP &node1 =VAL &k1 :key1 =VAL :one -MAP =VAL :top2 +MAP &node2 =VAL :key2 =VAL :two -MAP =VAL :top3 +MAP =VAL &k3 :key3 =VAL :three -MAP =VAL :top4 +MAP &node4 =VAL &k4 :key4 =VAL :four -MAP =VAL :top5 +MAP &node5 =VAL :key5 =VAL :five -MAP =VAL :top6 =VAL &val6 :six =VAL :top7 =VAL &val7 :seven -MAP -DOC -STR
# U9NS - Spec Example 2.8. Play by Play Feed from a Game
Tags:
header, spec
Source
Test Results
---
time: 20:03:20
player: Sammy Sosa
action: strike (miss)
...
---
time: 20:03:47
player: Sammy Sosa
action: grand slam
...
{
  "time": "20:03:20",
  "player": "Sammy Sosa",
  "action": "strike (miss)"
}
{
  "time": "20:03:47",
  "player": "Sammy Sosa",
  "action": "grand slam"
}
+STR +DOC --- +MAP =VAL :time =VAL :20:03:20 =VAL :player =VAL :Sammy Sosa =VAL :action =VAL :strike (miss) -MAP -DOC ... +DOC --- +MAP =VAL :time =VAL :20:03:47 =VAL :player =VAL :Sammy Sosa =VAL :action =VAL :grand slam -MAP -DOC ... -STR
# UDM2 - Plain URL in flow mapping
Tags:
flow, scalar
Source
Test Results
- { url: http://example.org }
[
  {
    "url": "http://example.org"
  }
]
+STR +DOC +SEQ +MAP =VAL :url =VAL :http://example.org -MAP -SEQ -DOC -STR
# UDR7 - Spec Example 5.4. Flow Collection Indicators
Tags:
flow, mapping, sequence, spec
Source
Test Results
sequence: [ one, two, ]
mapping: { sky: blue, sea: green }
{
  "sequence": [
    "one",
    "two"
  ],
  "mapping": {
    "sky": "blue",
    "sea": "green"
  }
}
+STR +DOC +MAP =VAL :sequence +SEQ =VAL :one =VAL :two -SEQ =VAL :mapping +MAP =VAL :sky =VAL :blue =VAL :sea =VAL :green -MAP -MAP -DOC -STR
# UGM3 - Spec Example 2.27. Invoice
Tags:
alias, literal, mapping, sequence, spec, tag
Source
Test Results
--- !<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.
{
  "invoice": 34843,
  "date": "2001-01-23",
  "bill-to": {
    "given": "Chris",
    "family": "Dumars",
    "address": {
      "lines": "458 Walkman Dr.\nSuite #292\n",
      "city": "Royal Oak",
      "state": "MI",
      "postal": 48046
    }
  },
  "ship-to": {
    "given": "Chris",
    "family": "Dumars",
    "address": {
      "lines": "458 Walkman Dr.\nSuite #292\n",
      "city": "Royal Oak",
      "state": "MI",
      "postal": 48046
    }
  },
  "product": [
    {
      "sku": "BL394D",
      "quantity": 4,
      "description": "Basketball",
      "price": 450
    },
    {
      "sku": "BL4438H",
      "quantity": 1,
      "description": "Super Hoop",
      "price": 2392
    }
  ],
  "tax": 251.42,
  "total": 4443.52,
  "comments": "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338."
}
+STR +DOC --- +MAP <tag:clarkevans.com,2002:invoice> =VAL :invoice =VAL :34843 =VAL :date =VAL :2001-01-23 =VAL :bill-to +MAP &id001 =VAL :given =VAL :Chris =VAL :family =VAL :Dumars =VAL :address +MAP =VAL :lines =VAL |458 Walkman Dr.\nSuite #292\n =VAL :city =VAL :Royal Oak =VAL :state =VAL :MI =VAL :postal =VAL :48046 -MAP -MAP =VAL :ship-to =ALI *id001 =VAL :product +SEQ +MAP =VAL :sku =VAL :BL394D =VAL :quantity =VAL :4 =VAL :description =VAL :Basketball =VAL :price =VAL :450.00 -MAP +MAP =VAL :sku =VAL :BL4438H =VAL :quantity =VAL :1 =VAL :description =VAL :Super Hoop =VAL :price =VAL :2392.00 -MAP -SEQ =VAL :tax =VAL :251.42 =VAL :total =VAL :4443.52 =VAL :comments =VAL :Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. -MAP -DOC -STR
# UT92 - Spec Example 9.4. Explicit Documents
Tags:
comment, footer, header, spec
Source
Test Results
---
{ matches
% : 20 }
...
---
# Empty
...
{
  "matches %": 20
}
null
+STR +DOC --- +MAP =VAL :matches % =VAL :20 -MAP -DOC ... +DOC --- =VAL : -DOC ... -STR
# V55R - Aliases in Block Sequence
Tags:
alias, sequence
Source
Test Results
- &a a
- &b b
- *a
- *b
[
  "a",
  "b",
  "a",
  "b"
]
+STR +DOC +SEQ =VAL &a :a =VAL &b :b =ALI *a =ALI *b -SEQ -DOC -STR
# V9D5 - Spec Example 8.19. Compact Block Mappings
Tags:
mapping, spec
Source
Test Results
- sun: yellow
- ? earth: blue
  : moon: white
+STR +DOC +SEQ +MAP =VAL :sun =VAL :yellow -MAP +MAP +MAP =VAL :earth =VAL :blue -MAP +MAP =VAL :moon =VAL :white -MAP -MAP -SEQ -DOC -STR
# W42U - Spec Example 8.15. Block Sequence Entry Types
Tags:
literal, sequence, spec
Source
Test Results
- # Empty
- |
 block node
- - one # Compact
  - two # sequence
- one: two # Compact mapping
[
  null,
  "block node\n",
  [
    "one",
    "two"
  ],
  {
    "one": "two"
  }
]
+STR +DOC +SEQ =VAL : =VAL |block node\n +SEQ =VAL :one =VAL :two -SEQ +MAP =VAL :one =VAL :two -MAP -SEQ -DOC -STR
# W4TN - Spec Example 9.5. Directives Documents
Tags:
1.3-err, footer, header, spec
Source
Test Results
%YAML 1.2
--- |
%!PS-Adobe-2.0
...
%YAML 1.2
---
# Empty
...
"%!PS-Adobe-2.0\n"
null
+STR +DOC --- =VAL |%!PS-Adobe-2.0\n -DOC ... +DOC --- =VAL : -DOC ... -STR
# W5VH - Allowed characters in alias
Tags:
1.3-err, alias
Source
Test Results
a: &:@*!$"<foo>: scalar a
b: *:@*!$"<foo>:
{
  "a": "scalar a",
  "b": "scalar a"
}
+STR +DOC +MAP =VAL :a =VAL &:@*!$"<foo>: :scalar a =VAL :b =ALI *:@*!$"<foo>: -MAP -DOC -STR
# WZ62 - Spec Example 7.2. Empty Content
Tags:
flow, scalar, spec
Source
Test Results
{
  foo : !!str,
  !!str : bar,
}
{
  "foo": "",
  "": "bar"
}
+STR +DOC +MAP =VAL :foo =VAL <tag:yaml.org,2002:str> : =VAL <tag:yaml.org,2002:str> : =VAL :bar -MAP -DOC -STR
# X38W - Aliases in Flow Objects
Tags:
alias, flow
Source
Test Results
{ &a [a, &b b]: *b, *a : [c, *b, d]}
+STR +DOC +MAP +SEQ &a =VAL :a =VAL &b :b -SEQ =ALI *b =ALI *a +SEQ =VAL :c =ALI *b =VAL :d -SEQ -MAP -DOC -STR
# XLQ9 - Multiline scalar that looks like a YAML directive
Tags:
directive, scalar
Source
Test Results
---
scalar
%YAML 1.2
"scalar %YAML 1.2"
+STR +DOC --- =VAL :scalar %YAML 1.2 -DOC -STR
# XV9V - Spec Example 6.5. Empty Lines [1.3]
Tags:
1.3-mod, scalar, spec
Source
Test Results
Folding:
  "Empty line

  as a line feed"
Chomping: |
  Clipped empty lines
 

{
  "Folding": "Empty line\nas a line feed",
  "Chomping": "Clipped empty lines\n"
}
+STR +DOC +MAP =VAL :Folding =VAL "Empty line\nas a line feed =VAL :Chomping =VAL |Clipped empty lines\n -MAP -DOC -STR
# XW4D - Various Trailing Comments
Tags:
1.3-err, comment
Source
Test Results
a: "double
  quotes" # lala
b: plain
 value  # lala
c  : #lala
  d
? # lala
 - seq1
: # lala
 - #lala
  seq2
e:
 &node # lala
 - x: y
block: > # lala
  abcde
+STR +DOC +MAP =VAL :a =VAL "double quotes =VAL :b =VAL :plain value =VAL :c =VAL :d +SEQ =VAL :seq1 -SEQ +SEQ =VAL :seq2 -SEQ =VAL :e +SEQ &node +MAP =VAL :x =VAL :y -MAP -SEQ =VAL :block =VAL >abcde\n -MAP -DOC -STR
# Y2GN - Anchor with colon in the middle
Tags:
anchor
Source
Test Results
---
key: &an:chor value
{
  "key": "value"
}
+STR +DOC --- +MAP =VAL :key =VAL &an:chor :value -MAP -DOC -STR
# YD5X - Spec Example 2.5. Sequence of Sequences
Tags:
sequence, spec
Source
Test Results
- [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
  ]
]
+STR +DOC +SEQ +SEQ =VAL :name =VAL :hr =VAL :avg -SEQ +SEQ =VAL :Mark McGwire =VAL :65 =VAL :0.278 -SEQ +SEQ =VAL :Sammy Sosa =VAL :63 =VAL :0.288 -SEQ -SEQ -DOC -STR
# Z67P - Spec Example 8.21. Block Scalar Nodes [1.3]
Tags:
1.3-mod, folded, literal, spec
Source
Test Results
literal: |2
  value
folded: !foo >1
 value
{
  "literal": "value\n",
  "folded": "value\n"
}
+STR +DOC +MAP =VAL :literal =VAL |value\n =VAL :folded =VAL <!foo> >value\n -MAP -DOC -STR
# Z9M4 - Spec Example 6.22. Global Tag Prefix
Tags:
header, spec, tag
Source
Test Results
%TAG !e! tag:example.com,2000:app/
---
- !e!foo "bar"
+STR +DOC --- +SEQ =VAL <tag:example.com,2000:app/foo> "bar -SEQ -DOC -STR
# ZF4X - Spec Example 2.6. Mapping of Mappings
Tags:
mapping, spec
Source
Test Results
Mark McGwire: {hr: 65, avg: 0.278}
Sammy Sosa: {
    hr: 63,
    avg: 0.288
  }
{
  "Mark McGwire": {
    "hr": 65,
    "avg": 0.278
  },
  "Sammy Sosa": {
    "hr": 63,
    "avg": 0.288
  }
}
+STR +DOC +MAP =VAL :Mark McGwire +MAP =VAL :hr =VAL :65 =VAL :avg =VAL :0.278 -MAP =VAL :Sammy Sosa +MAP =VAL :hr =VAL :63 =VAL :avg =VAL :0.288 -MAP -MAP -DOC -STR
# ZH7C - Anchors in Mapping
Tags:
jayt
Source
Test Results
&a a: b
c: &d d
{
  "a": "b",
  "c": "d"
}
+STR +DOC +MAP =VAL &a :a =VAL :b =VAL :c =VAL &d :d -MAP -DOC -STR
# ZWK4 - Key with anchor after missing explicit mapping value
Tags:
anchor, mapping
Source
Test Results
---
a: 1
? b
&anchor c: 3
{
  "a": 1,
  "b": null,
  "c": 3
}
+STR +DOC --- +MAP =VAL :a =VAL :1 =VAL :b =VAL : =VAL &anchor :c =VAL :3 -MAP -DOC -STR