10 "avg: 0.278 # Batting average\n"
11 "rbi: 147 # Runs Batted In";
17 "- New York Yankees\n"
25 " name: Mark McGwire\n"
34 "- [name , hr, avg ]\n"
35 "- [Mark McGwire, 65, 0.278]\n"
36 "- [Sammy Sosa , 63, 0.288]";
39 "Mark McGwire: {hr: 65, avg: 0.278}\n"
46 "# Ranking of 1998 home runs\n"
55 "- St Louis Cardinals";
60 "player: Sammy Sosa\n"
61 "action: strike (miss)\n"
65 "player: Sammy Sosa\n"
66 "action: grand slam\n"
71 "hr: # 1998 hr ranking\n"
75 " # 1998 rbi ranking\n"
83 " # Following node labeled SS\n"
86 " - *SS # Subsequent occurrence\n"
90 "? - Detroit Tigers\n"
95 "? [ New York Yankees,\n"
97 ": [ 2001-07-02, 2001-08-12,\n"
102 "# Products purchased\n"
103 "- item : Super Hoop\n"
105 "- item : Basketball\n"
107 "- item : Big Shoes\n"
119 " year was crippled\n"
120 " by a knee injury.";
124 " Sammy Sosa completed another\n"
125 " fine season with great stats.\n"
128 " 0.288 Batting Average\n"
133 "name: Mark McGwire\n"
134 "accomplishment: >\n"
135 " Mark set a major league\n"
136 " home run record in 1998.\n"
139 " 0.278 Batting Average\n";
142 "unicode: \"Sosa did fine.\\u263A\"\n"
143 "control: \"\\b1998\\t1999\\t2000\\n\"\n"
144 "hex esc: \"\\x0d\\x0a is \\r\\n\"\n"
146 "single: '\"Howdy!\" he cried.'\n"
147 "quoted: ' # Not a ''comment''.'\n"
148 "tie-fighter: '|\\-*-/|'";
152 " This unquoted scalar\n"
153 " spans many lines.\n"
155 "quoted: \"So does this\n"
156 " quoted scalar.\\n\"";
158 // TODO: 2.19 - 2.22 schema tags
162 "not-date: !!str 2002-04-28\n"
164 "picture: !!binary |\n"
165 " R0lGODlhDAAMAIQAAP//9/X\n"
166 " 17unp5WZmZgAAAOfn515eXv\n"
167 " Pz7Y6OjuDg4J+fn5OTk6enp\n"
168 " 56enmleECcgggoBADs=\n"
170 "application specific tag: !something |\n"
171 " The semantics of the tag\n"
172 " above may be different for\n"
173 " different documents.";
176 "%TAG ! tag:clarkevans.com,2002:\n"
178 " # Use the ! handle for presenting\n"
179 " # tag:clarkevans.com,2002:circle\n"
181 " center: &ORIGIN {x: 73, y: 129}\n"
185 " finish: { x: 89, y: 102 }\n"
189 " text: Pretty vector drawing.";
192 "# Sets are represented as a\n"
193 "# Mapping where each key is\n"
194 "# associated with a null value\n"
201 "# Ordered maps are represented as\n"
202 "# A sequence of mappings, with\n"
203 "# each mapping having one key\n"
205 "- Mark McGwire: 65\n"
210 "--- !<tag:clarkevans.com,2002:invoice>\n"
212 "date : 2001-01-23\n"
220 " city : Royal Oak\n"
227 " description : Basketball\n"
231 " description : Super Hoop\n"
236 " Late afternoon is best.\n"
237 " Backup contact is Nancy\n"
238 " Billsmer @ 338-4338.";
242 "Time: 2001-11-23 15:01:42 -5\n"
245 " This is an error message\n"
246 " for the log file\n"
248 "Time: 2001-11-23 15:02:31 -5\n"
251 " A slightly different error\n"
254 "Date: 2001-11-23 15:03:17 -5\n"
257 " Unknown variable \"bar\"\n"
259 " - file: TopClass.py\n"
262 " x = MoreObject(\"345\\n\")\n"
263 " - file: MoreClass.py\n"
268 // TODO: 5.1 - 5.2 BOM
280 "sequence: [ one, two, ]\n"
281 "mapping: { sky: blue, sea: green }";
287 "anchored: !local &anchor value\n"
302 // TODO: 5.9 directive
303 // TODO: 5.10 reserved indicator
307 " Line break (no glyph)\n"
308 " Line break (glyphed)\n";
311 "# Tabs and spaces\n"
312 "quoted: \"Quoted\t\"\n"
315 " \tprintf(\"Hello, world!\\n\");\n"
320 "\\\" \\a \\b \\e \\f \\\n"
321 "\\n \\r \\t \\v \\0 \\\n"
322 "\\ \\_ \\N \\L \\P \\\n"
323 "\\x41 \\u0041 \\U00000041\"";
331 " # Leading comment line spaces are\n"
332 " # neither content nor indentation.\n"
338 " Flow style: [ # Leading spaces\n"
339 " By two, # in flow style\n"
340 " Also by two, # are neither\n"
341 " \tStill by two # content nor\n"
368 " as a line feed\"\n"
370 " Clipped empty lines\n"
415 "{ first: Sammy, last: Sosa }:\n"
423 "%FOO bar baz # Should be ignored\n"
424 " # with a warning.\n"
428 "%YAML 1.3 # Attempt parsing\n"
429 " # with a warning\n"
439 "%TAG !yaml! tag:yaml.org,2002:\n"
453 "%TAG ! tag:example.com,2000:app/\n"
458 "%TAG !! tag:example.com,2000:app/\n"
460 "!!int 1 - 3 # Interval, not integer";
463 "%TAG !e! tag:example.com,2000:app/\n"
470 "!m!light fluorescent\n"
477 "%TAG !e! tag:example.com,2000:app/\n"
482 "!!str &a1 \"foo\":\n"
487 "!<tag:yaml.org,2002:str> foo :\n"
495 "%TAG !e! tag:example.com,2000:app/\n"
501 const char *ex6_27a
=
502 "%TAG !e! tag:example,2000:app/\n"
506 const char *ex6_27b
=
507 "%TAG !e! tag:example,2000:app/\n"
512 "# Assuming conventional resolution:\n"
518 "First occurrence: &anchor Value\n"
519 "Second occurrence: *anchor";
522 "First occurrence: &anchor Foo\n"
523 "Second occurrence: *anchor\n"
524 "Override anchor: &anchor Bar\n"
525 "Reuse anchor: *anchor";
540 "\"implicit block key\" : [\n"
541 " \"implicit flow key\" : value,\n"
548 "to a line feed, or \t\\\n"
549 " \\ \tnon-content\"";
555 "\t3rd non-empty \"";
558 " 'here''s to \"quotes\"'";
561 "'implicit block key' : [\n"
562 " 'implicit flow key' : value,\n"
572 "# Outside flow collection:\n"
575 "- Up, up, and away!\n"
577 "- http://example.com/foo#bar\n"
578 "# Inside flow collection:\n"
581 " \"Up, up, and away!\",\n"
583 " http://example.com/foo#bar ]";
586 "implicit block key : [\n"
587 " implicit flow key : value,\n"
603 " quoted\", 'single\n"
606 " text, [ nested ],\n"
611 "- { one : two , three: four , }\n"
612 "- {five: six,seven : eight}";
616 "? explicit: entry,\n"
623 "unquoted : \"separate\",\n"
631 "\"adjacent\":value,\n"
632 "\"readable\":value,\n"
648 "- [ YAML : separate ]\n"
649 "- [ : empty key entry ]\n"
650 "- [ {JSON: like}:adjacent ]";
654 " bar: invalid,"; // Note: we don't check (on purpose) the >1K chars for an implicit key
671 "- | # Empty header\n"
673 "- >1 # Indentation indicator\n"
675 "- |+ # Chomping indicator\n"
678 "- >1- # Both indicators\n"
786 const char *ex8_11
= ex8_10
;
787 const char *ex8_12
= ex8_10
;
788 const char *ex8_13
= ex8_10
;
799 "- - one # Compact\n"
800 " - two # sequence\n"
801 "- one: two # Compact mapping\n";
808 "? explicit key # Empty value\n"
811 ": - one # Explicit compact\n"
812 " - two # block value\n";
815 "plain key: in-line value\n"
827 " \"flow in block\"\n"
830 "- !!map # Block collection\n"