1YAML::PP(3)           User Contributed Perl Documentation          YAML::PP(3)
2
3
4

NAME

6       YAML::PP - YAML 1.2 processor
7

SYNOPSIS

9       WARNING: Most of the inner API is not stable yet.
10
11       Here are a few examples of the basic load and dump methods:
12
13           use YAML::PP;
14           my $ypp = YAML::PP->new;
15
16           my $yaml = <<'EOM';
17           --- # Document one is a mapping
18           name: Tina
19           age: 29
20           favourite language: Perl
21
22           --- # Document two is a sequence
23           - plain string
24           - 'in single quotes'
25           - "in double quotes we have escapes! like \t and \n"
26           - | # a literal block scalar
27             line1
28             line2
29           - > # a folded block scalar
30             this is all one
31             single line because the
32             linebreaks will be folded
33           EOM
34
35           my @documents = $ypp->load_string($yaml);
36           my @documents = $ypp->load_file($filename);
37
38           my $yaml = $ypp->dump_string($data1, $data2);
39           $ypp->dump_file($filename, $data1, $data2);
40
41           # The loader offers JSON::PP::Boolean, boolean.pm or
42           # perl 1/'' (currently default) for booleans
43           my $ypp = YAML::PP->new(boolean => 'JSON::PP');
44           my $ypp = YAML::PP->new(boolean => 'boolean');
45           my $ypp = YAML::PP->new(boolean => 'perl');
46
47           # Enable perl data types and objects
48           my $ypp = YAML::PP->new(schema => [qw/ + Perl /]);
49           my $yaml = $yp->dump_string($data_with_perl_objects);
50
51           # Legacy interface
52           use YAML::PP qw/ Load Dump LoadFile DumpFile /;
53           my @documents = Load($yaml);
54           my @documents = LoadFile($filename);
55           my @documents = LoadFile($filehandle);
56           my $yaml = = Dump(@documents);
57           DumpFile($filename, @documents);
58           DumpFile($filenhandle @documents);
59
60       Some utility scripts, mostly useful for debugging:
61
62           # Load YAML into a data structure and dump with Data::Dumper
63           yamlpp-load < file.yaml
64
65           # Load and Dump
66           yamlpp-load-dump < file.yaml
67
68           # Print the events from the parser in yaml-test-suite format
69           yamlpp-events < file.yaml
70
71           # Parse and emit events directly without loading
72           yamlpp-parse-emit < file.yaml
73
74           # Create ANSI colored YAML. Can also be useful for invalid YAML, showing
75           # you the exact location of the error
76           yamlpp-highlight < file.yaml
77

DESCRIPTION

79       YAML::PP is a modular YAML processor.
80
81       It aims to support "YAML 1.2" and "YAML 1.1". See <https://yaml.org/>.
82       Some (rare) syntax elements are not yet supported and documented below.
83
84       YAML is a serialization language. The YAML input is called "YAML
85       Stream".  A stream consists of one or more "Documents", separated by a
86       line with a document start marker "---". A document optionally ends
87       with the document end marker "...".
88
89       This allows one to process continuous streams additionally to a fixed
90       input file or string.
91
92       The YAML::PP frontend will currently load all documents, and return
93       only the first if called with scalar context.
94
95       The YAML backend is implemented in a modular way that allows one to add
96       custom handling of YAML tags, perl objects and data types. The inner
97       API is not yet stable. Suggestions welcome.
98
99       You can check out all current parse and load results from the yaml-
100       test-suite here:
101       <https://perlpunk.github.io/YAML-PP-p5/test-suite.html>
102

METHODS

104   new
105           my $ypp = YAML::PP->new;
106           # load booleans via boolean.pm
107           my $ypp = YAML::PP->new( boolean => 'boolean' );
108           # load booleans via JSON::PP::true/false
109           my $ypp = YAML::PP->new( boolean => 'JSON::PP' );
110
111           # use YAML 1.2 Failsafe Schema
112           my $ypp = YAML::PP->new( schema => ['Failsafe'] );
113           # use YAML 1.2 JSON Schema
114           my $ypp = YAML::PP->new( schema => ['JSON'] );
115           # use YAML 1.2 Core Schema
116           my $ypp = YAML::PP->new( schema => ['Core'] );
117
118           # Die when detecting cyclic references
119           my $ypp = YAML::PP->new( cyclic_refs => 'fatal' );
120
121           my $ypp = YAML::PP->new(
122               boolean => 'JSON::PP',
123               schema => ['Core'],
124               cyclic_refs => 'fatal',
125               indent => 4,
126               header => 1,
127               footer => 1,
128               version_directive => 1,
129           );
130
131       Options:
132
133       boolean
134           Values: "perl" (currently default), "JSON::PP", "boolean"
135
136           This option is for loading and dumping.
137
138           Note that when dumping, only the chosen boolean style will be
139           recognized.  So if you choose "JSON::PP", "boolean" objects will
140           not be recognized as booleans and will be dumped as ordinary
141           objects (if you enable the Perl schema).
142
143       schema
144           Default: "['Core']"
145
146           This option is for loading and dumping.
147
148           Array reference. Here you can define what schema to use.  Supported
149           standard Schemas are: "Failsafe", "JSON", "Core", "YAML1_1".
150
151           To get an overview how the different Schemas behave, see
152           <https://perlpunk.github.io/YAML-PP-p5/schemas.html>
153
154           Additionally you can add further schemas, for example "Merge".
155
156       cyclic_refs
157           Default: 'allow' but will be switched to fatal in the future for
158           safety!
159
160           This option is for loading only.
161
162           Defines what to do when a cyclic reference is detected when
163           loading.
164
165               # fatal  - die
166               # warn   - Just warn about them and replace with undef
167               # ignore - replace with undef
168               # allow  - Default
169
170       duplicate_keys
171           Default: 0
172
173           Since version 0.027
174
175           This option is for loading.
176
177           The YAML Spec says duplicate mapping keys should be forbidden.
178
179           When set to true, duplicate keys in mappings are allowed (and will
180           overwrite the previous key).
181
182           When set to false, duplicate keys will result in an error when
183           loading.
184
185           This is especially useful when you have a longer mapping and don't
186           see the duplicate key in your editor:
187
188               ---
189               a: 1
190               b: 2
191               # .............
192               a: 23 # error
193
194       indent
195           Default: 2
196
197           This option is for dumping.
198
199           Use that many spaces for indenting
200
201       width
202           Since version 0.025
203
204           Default: 80
205
206           This option is for dumping.
207
208           Maximum columns when dumping.
209
210           This is only respected when dumping flow collections right now.
211
212           in the future it will be used also for wrapping long strings.
213
214       header
215           Default: 1
216
217           This option is for dumping.
218
219           Print document header "---"
220
221       footer
222           Default: 0
223
224           This option is for dumping.
225
226           Print document footer "..."
227
228       yaml_version
229           Since version 0.020
230
231           This option is for loading and dumping.
232
233           Default: 1.2
234
235           Note that in this case, a directive "%YAML 1.1" will basically be
236           ignored and everything loaded with the "1.2 Core" Schema.
237
238           If you want to support both YAML 1.1 and 1.2, you have to specify
239           that, and the schema ("Core" or "YAML1_1") will be chosen
240           automatically.
241
242               my $yp = YAML::PP->new(
243                   yaml_version => ['1.2', '1.1'],
244               );
245
246           This is the same as
247
248               my $yp = YAML::PP->new(
249                   schema => ['+'],
250                   yaml_version => ['1.2', '1.1'],
251               );
252
253           because the "+" stands for the default schema per version.
254
255           When loading, and there is no %YAML directive, 1.2 will be
256           considered as default, and the "Core" schema will be used.
257
258           If there is a "%YAML 1.1" directive, the "YAML1_1" schema will be
259           used.
260
261           Of course, you can also make 1.1 the default:
262
263               my $yp = YAML::PP->new(
264                   yaml_version => ['1.1', '1.2'],
265               );
266
267           You can also specify 1.1 only:
268
269               my $yp = YAML::PP->new(
270                   yaml_version => ['1.1'],
271               );
272
273           In this case also documents with "%YAML 1.2" will be loaded with
274           the "YAML1_1" schema.
275
276       version_directive
277           Since version 0.020
278
279           This option is for dumping.
280
281           Default: 0
282
283           Print Version Directive "%YAML 1.2" (or "%YAML 1.1") on top of each
284           YAML document. It will use the first version specified in the
285           "yaml_version" option.
286
287       preserve
288           Since version 0.021
289
290           Default: false
291
292           This option is for loading and dumping.
293
294           Preserving scalar styles is still experimental.
295
296               use YAML::PP::Common qw/ PRESERVE_ORDER PRESERVE_SCALAR_STYLE /;
297
298               # Preserve the order of hash keys
299               my $yp = YAML::PP->new( preserve => PRESERVE_ORDER );
300
301               # Preserve the quoting style of scalars
302               my $yp = YAML::PP->new( preserve => PRESERVE_SCALAR_STYLE );
303
304               # Preserve block/flow style (since 0.024)
305               my $yp = YAML::PP->new( preserve => PRESERVE_FLOW_STYLE );
306
307               # Preserve alias names (since 0.027)
308               my $yp = YAML::PP->new( preserve => PRESERVE_ALIAS );
309
310               # Combine, e.g. preserve order and scalar style
311               my $yp = YAML::PP->new( preserve => PRESERVE_ORDER | PRESERVE_SCALAR_STYLE );
312
313           Do NOT rely on the internal implementation of it.
314
315           If you load the following input:
316
317               ---
318               z: 1
319               a: 2
320               ---
321               - plain
322               - 'single'
323               - "double"
324               - |
325                 literal
326               ---
327               block mapping: &alias
328                 flow sequence: [a, b]
329               same mapping: *alias
330               flow mapping: {a: b}
331
332           with this code:
333
334               my $yp = YAML::PP->new(
335                   preserve => PRESERVE_ORDER | PRESERVE_SCALAR_STYLE
336                               | PRESERVE_FLOW_STYLE | PRESERVE_ALIAS
337               );
338               my ($hash, $styles, $flow) = $yp->load_file($file);
339               $yp->dump_file($hash, $styles, $flow);
340
341           Then dumping it will return the same output.  Only folded block
342           scalars '>' cannot preserve the style yet.
343
344           Note that YAML allows repeated definition of anchors. They cannot
345           be preserved with YAML::PP right now. Example:
346
347               ---
348               - &seq [a]
349               - *seq
350               - &seq [b]
351               - *seq
352
353           Because the data could be shuffled before dumping again, the anchor
354           definition could be broken. In this case repeated anchor names will
355           be discarded when loading and dumped with numeric anchors like
356           usual.
357
358           Implementation:
359
360           When loading, hashes will be tied to an internal class
361           ("YAML::PP::Preserve::Hash") that keeps the key order.
362
363           Scalars will be returned as objects of an internal class
364           ("YAML::PP::Preserve::Scalar") with overloading. If you assign to
365           such a scalar, the object will be replaced by a simple scalar.
366
367               # assignment, style gets lost
368               $styles->[1] .= ' append';
369
370           You can also pass 1 as a value. In this case all preserving options
371           will be enabled, also if there are new options added in the future.
372
373           There are also methods to create preserved nodes from scratch. See
374           the "preserved_(scalar|mapping|sequence)" "METHODS" below.
375
376   load_string
377           my $doc = $ypp->load_string("foo: bar");
378           my @docs = $ypp->load_string("foo: bar\n---\n- a");
379
380       Input should be Unicode characters.
381
382       So if you read from a file, you should decode it, for example with
383       "Encode::decode()".
384
385       Note that in scalar context, "load_string" and "load_file" return the
386       first document (like YAML::Syck), while YAML and YAML::XS return the
387       last.
388
389   load_file
390           my $doc = $ypp->load_file("file.yaml");
391           my @docs = $ypp->load_file("file.yaml");
392
393       Strings will be loaded as unicode characters.
394
395   dump_string
396           my $yaml = $ypp->dump_string($doc);
397           my $yaml = $ypp->dump_string($doc1, $doc2);
398           my $yaml = $ypp->dump_string(@docs);
399
400       Input strings should be Unicode characters.
401
402       Output will return Unicode characters.
403
404       So if you want to write that to a file (or pass to YAML::XS, for
405       example), you typically encode it via "Encode::encode()".
406
407   dump_file
408           $ypp->dump_file("file.yaml", $doc);
409           $ypp->dump_file("file.yaml", $doc1, $doc2);
410           $ypp->dump_file("file.yaml", @docs);
411
412       Input data should be Unicode characters.
413
414   dump
415       This will dump to a predefined writer. By default it will just use the
416       YAML::PP::Writer and output a string.
417
418           my $writer = MyWriter->new(\my $output);
419           my $yp = YAML::PP->new(
420               writer => $writer,
421           );
422           $yp->dump($data);
423
424   preserved_scalar
425       Since version 0.024
426
427       Experimental. Please report bugs or let me know this is useful and
428       works.
429
430       You can define a certain scalar style when dumping data.  Figuring out
431       the best style is a hard task and practically impossible to get it
432       right for all cases. It's also a matter of taste.
433
434           use YAML::PP::Common qw/ PRESERVE_SCALAR_STYLE YAML_LITERAL_SCALAR_STYLE /;
435           my $yp = YAML::PP->new(
436               preserve => PRESERVE_SCALAR_STYLE,
437           );
438           # a single linebreak would normally be dumped with double quotes: "\n"
439           my $scalar = $yp->preserved_scalar("\n", style => YAML_LITERAL_SCALAR_STYLE );
440
441           my $data = { literal => $scalar };
442           my $dump = $yp->dump_string($data);
443           # output
444           ---
445           literal: |+
446
447           ...
448
449   preserved_mapping, preserved_sequence
450       Since version 0.024
451
452       Experimental. Please report bugs or let me know this is useful and
453       works.
454
455       With this you can define which nodes are dumped with the more compact
456       flow style instead of block style.
457
458       If you add "PRESERVE_ORDER" to the "preserve" option, it will also keep
459       the order of the keys in a hash.
460
461           use YAML::PP::Common qw/
462               PRESERVE_ORDER PRESERVE_FLOW_STYLE
463               YAML_FLOW_MAPPING_STYLE YAML_FLOW_SEQUENCE_STYLE
464           /;
465           my $yp = YAML::PP->new(
466               preserve => PRESERVE_FLOW_STYLE | PRESERVE_ORDER
467           );
468
469           my $hash = $yp->preserved_mapping({}, style => YAML_FLOW_MAPPING_STYLE);
470           # Add values after initialization to preserve order
471           %$hash = (z => 1, a => 2, y => 3, b => 4);
472
473           my $array = $yp->preserved_sequence([23, 24], style => YAML_FLOW_SEQUENCE_STYLE);
474
475           my $data = $yp->preserved_mapping({});
476           %$data = ( map => $hash, seq => $array );
477
478           my $dump = $yp->dump_string($data);
479           # output
480           ---
481           map: {z: 1, a: 2, y: 3, b: 4}
482           seq: [23, 24]
483
484   loader
485       Returns or sets the loader object, by default YAML::PP::Loader
486
487   dumper
488       Returns or sets the dumper object, by default YAML::PP::Dumper
489
490   schema
491       Returns or sets the schema object
492
493   default_schema
494       Creates and returns the default schema
495

FUNCTIONS

497       The functions "Load", "LoadFile", "Dump" and "DumpFile" are provided as
498       a drop-in replacement for other existing YAML processors.  No function
499       is exported by default.
500
501       Note that in scalar context, "Load" and "LoadFile" return the first
502       document (like YAML::Syck), while YAML and YAML::XS return the last.
503
504       Load
505               use YAML::PP qw/ Load /;
506               my $doc = Load($yaml);
507               my @docs = Load($yaml);
508
509           Works like "load_string".
510
511       LoadFile
512               use YAML::PP qw/ LoadFile /;
513               my $doc = LoadFile($file);
514               my @docs = LoadFile($file);
515               my @docs = LoadFile($filehandle);
516
517           Works like "load_file".
518
519       Dump
520               use YAML::PP qw/ Dump /;
521               my $yaml = Dump($doc);
522               my $yaml = Dump(@docs);
523
524           Works like "dump_string".
525
526       DumpFile
527               use YAML::PP qw/ DumpFile /;
528               DumpFile($file, $doc);
529               DumpFile($file, @docs);
530               DumpFile($filehandle, @docs);
531
532           Works like "dump_file".
533

PLUGINS

535       You can alter the behaviour of YAML::PP by using the following schema
536       classes:
537
538       YAML::PP::Schema::Failsafe
539           One of the three YAML 1.2 official schemas
540
541       YAML::PP::Schema::JSON
542           One of the three YAML 1.2 official schemas.
543
544       YAML::PP::Schema::Core
545           One of the three YAML 1.2 official schemas. Default
546
547       YAML::PP::Schema::YAML1_1
548           Schema implementing the most common YAML 1.1 types
549
550       YAML::PP::Schema::Perl
551           Serializing Perl objects and types
552
553       YAML::PP::Schema::Binary
554           Serializing binary data
555
556       YAML::PP::Schema::Tie::IxHash
557           Deprecated. See option "preserve"
558
559       YAML::PP::Schema::Merge
560           YAML 1.1 merge keys for mappings
561
562       YAML::PP::Schema::Include
563           Include other YAML files via "!include" tags
564
565       To make the parsing process faster, you can plugin the libyaml parser
566       with YAML::PP::LibYAML.
567

IMPLEMENTATION

569       The process of loading and dumping is split into the following steps:
570
571           Load:
572
573           YAML Stream        Tokens        Event List        Data Structure
574                     --------->    --------->        --------->
575                       lex           parse           construct
576
577
578           Dump:
579
580           Data Structure       Event List        YAML Stream
581                       --------->        --------->
582                       represent           emit
583
584       You can dump basic perl types like hashes, arrays, scalars (strings,
585       numbers).  For dumping blessed objects and things like coderefs have a
586       look at YAML::PP::Perl/YAML::PP::Schema::Perl.
587
588       YAML::PP::Lexer
589           The Lexer is reading the YAML stream into tokens. This makes it
590           possible to generate syntax highlighted YAML output.
591
592           Note that the API to retrieve the tokens will change.
593
594       YAML::PP::Parser
595           The Parser retrieves the tokens from the Lexer. The main YAML
596           content is then parsed with the Grammar.
597
598       YAML::PP::Grammar
599       YAML::PP::Constructor
600           The Constructor creates a data structure from the Parser events.
601
602       YAML::PP::Loader
603           The Loader combines the constructor and parser.
604
605       YAML::PP::Dumper
606           The Dumper will delegate to the Representer
607
608       YAML::PP::Representer
609           The Representer will create Emitter events from the given data
610           structure.
611
612       YAML::PP::Emitter
613           The Emitter creates a YAML stream.
614
615   YAML::PP::Parser
616       Still TODO:
617
618       Implicit collection keys
619               ---
620               [ a, b, c ]: value
621
622       Implicit mapping in flow style sequences
623               ---
624               [ a, b, c: d ]
625               # equals
626               [ a, b, { c: d } ]
627
628       Plain mapping keys ending with colons
629               ---
630               key ends with two colons::: value
631
632       Supported Characters
633           If you have valid YAML that's not parsed, or the other way round,
634           please create an issue.
635
636       Line and Column Numbers
637           You will see line and column numbers in the error message. The
638           column numbers might still be wrong in some cases.
639
640       Error Messages
641           The error messages need to be improved.
642
643       Unicode Surrogate Pairs
644           Currently loaded as single characters without validating
645
646       Possibly more
647
648   YAML::PP::Constructor
649       The Constructor now supports all three YAML 1.2 Schemas, Failsafe, JSON
650       and Core.  Additionally you can choose the schema for YAML 1.1 as
651       "YAML1_1".
652
653       Too see what strings are resolved as booleans, numbers, null etc. look
654       at <https://perlpunk.github.io/YAML-PP-p5/schema-examples.html>.
655
656       You can choose the Schema like this:
657
658           my $ypp = YAML::PP->new(schema => ['JSON']); # default is 'Core'
659
660       The Tags "!!seq" and "!!map" are still ignored for now.
661
662       It supports:
663
664       Handling of Anchors/Aliases
665           Like in modules like YAML, the Constructor will use references for
666           mappings and sequences, but obviously not for scalars.
667
668           YAML::XS uses real aliases, which allows also aliasing scalars. I
669           might add an option for that since aliasing is now available in
670           pure perl.
671
672       Boolean Handling
673           You can choose between 'perl' (1/'', currently default), 'JSON::PP'
674           and 'boolean'.pm for handling boolean types.  That allows you to
675           dump the data structure with one of the JSON modules without losing
676           information about booleans.
677
678       Numbers
679           Numbers are created as real numbers instead of strings, so that
680           they are dumped correctly by modules like JSON::PP or JSON::XS, for
681           example.
682
683       Complex Keys
684           Mapping Keys in YAML can be more than just scalars. Of course, you
685           can't load that into a native perl structure. The Constructor will
686           stringify those keys with Data::Dumper instead of just returning
687           something like "HASH(0x55dc1b5d0178)".
688
689           Example:
690
691               use YAML::PP;
692               use JSON::PP;
693               my $ypp = YAML::PP->new;
694               my $coder = JSON::PP->new->ascii->pretty->allow_nonref->canonical;
695               my $yaml = <<'EOM';
696               complex:
697                   ?
698                       ?
699                           a: 1
700                           c: 2
701                       : 23
702                   : 42
703               EOM
704               my $data = $yppl->load_string($yaml);
705               say $coder->encode($data);
706               __END__
707               {
708                  "complex" : {
709                     "{'{a => 1,c => 2}' => 23}" : 42
710                  }
711               }
712
713       TODO:
714
715       Parse Tree
716           I would like to generate a complete parse tree, that allows you to
717           manipulate the data structure and also dump it, including all
718           whitespaces and comments.  The spec says that this is throwaway
719           content, but I read that many people wish to be able to keep the
720           comments.
721
722   YAML::PP::Dumper, YAML::PP::Emitter
723       The Dumper should be able to dump strings correctly, adding quotes
724       whenever a plain scalar would look like a special string, like "true",
725       or when it contains or starts with characters that are not allowed.
726
727       Most strings will be dumped as plain scalars without quotes. If they
728       contain special characters or have a special meaning, they will be
729       dumped with single quotes. If they contain control characters,
730       including <"\n">, they will be dumped with double quotes.
731
732       It will recognize JSON::PP::Boolean and boolean.pm objects and dump
733       them correctly.
734
735       Numbers which also have a "PV" flag will be recognized as numbers and
736       not as strings:
737
738           my $int = 23;
739           say "int: $int"; # $int will now also have a PV flag
740
741       That means that if you accidentally use a string in numeric context, it
742       will also be recognized as a number:
743
744           my $string = "23";
745           my $something = $string + 0;
746           print $yp->dump_string($string);
747           # will be emitted as an integer without quotes!
748
749       The layout is like libyaml output:
750
751           key:
752           - a
753           - b
754           - c
755           ---
756           - key1: 1
757             key2: 2
758             key3: 3
759           ---
760           - - a1
761             - a2
762           - - b1
763             - b2
764

WHY

766       All the available parsers and loaders for Perl are behaving
767       differently, and more important, aren't conforming to the spec.
768       YAML::XS is doing pretty well, but "libyaml" only handles YAML 1.1 and
769       diverges a bit from the spec. The pure perl loaders lack support for a
770       number of features.
771
772       I was going over YAML.pm issues end of 2016, integrating old patches
773       from rt.cpan.org and creating some pull requests myself. I realized
774       that it would be difficult to patch YAML.pm to parse YAML 1.1 or even
775       1.2, and it would also break existing usages relying on the current
776       behaviour.
777
778       In 2016 Ingy döt Net initiated two really cool projects:
779
780       "YAML TEST SUITE"
781       "YAML EDITOR"
782
783       These projects are a big help for any developer. So I got the idea to
784       write my own parser and started on New Year's Day 2017.  Without the
785       test suite and the editor I would have never started this.
786
787       I also started another YAML Test project which allows one to get a
788       quick overview of which frameworks support which YAML features:
789
790       "YAML TEST MATRIX"
791
792   YAML TEST SUITE
793       <https://github.com/yaml/yaml-test-suite>
794
795       It contains about 230 test cases and expected parsing events and more.
796       There will be more tests coming. This test suite allows you to write
797       parsers without turning the examples from the Specification into tests
798       yourself.  Also the examples aren't completely covering all cases - the
799       test suite aims to do that.
800
801       The suite contains .tml files, and in a separate 'data' release you
802       will find the content in separate files, if you can't or don't want to
803       use TestML.
804
805       Thanks also to Felix Krause, who is writing a YAML parser in Nim.  He
806       turned all the spec examples into test cases.
807
808   YAML EDITOR
809       This is a tool to play around with several YAML parsers and loaders in
810       vim.
811
812       <https://github.com/yaml/yaml-editor>
813
814       The project contains the code to build the frameworks (16 as of this
815       writing) and put it into one big Docker image.
816
817       It also contains the yaml-editor itself, which will start a vim in the
818       docker container. It uses a lot of funky vimscript that makes playing
819       with it easy and useful. You can choose which frameworks you want to
820       test and see the output in a grid of vim windows.
821
822       Especially when writing a parser it is extremely helpful to have all
823       the test cases and be able to play around with your own examples to see
824       how they are handled.
825
826   YAML TEST MATRIX
827       I was curious to see how the different frameworks handle the test
828       cases, so, using the test suite and the docker image, I wrote some code
829       that runs the tests, manipulates the output to compare it with the
830       expected output, and created a matrix view.
831
832       <https://github.com/perlpunk/yaml-test-matrix>
833
834       You can find the latest build at <https://matrix.yaml.io>
835
836       As of this writing, the test matrix only contains valid test cases.
837       Invalid ones will be added.
838

CONTRIBUTORS

840       Ingy döt Net
841           Ingy is one of the creators of YAML. In 2016 he started the YAML
842           Test Suite and the YAML Editor. He also made useful suggestions on
843           the class hierarchy of YAML::PP.
844
845       Felix "flyx" Krause
846           Felix answered countless questions about the YAML Specification.
847

SEE ALSO

849       YAML
850       YAML::XS
851       YAML::Syck
852       YAML::Tiny
853       YAML::PP::LibYAML
854       YAML::LibYAML::API
855       <https://www.yaml.info>
856

SPONSORS

858       The Perl Foundation <https://www.perlfoundation.org/> sponsored this
859       project (and the YAML Test Suite) with a grant of 2500 USD in
860       2017-2018.
861
863       Copyright 2017-2020 by Tina Müller
864
865       This library is free software and may be distributed under the same
866       terms as perl itself.
867
868
869
870perl v5.34.0                      2021-10-25                       YAML::PP(3)
Impressum