App-Dex

 view release on metacpan or  search on metacpan

scripts/dex  view on Meta::CPAN

  
  Numbers which also have a C<PV> flag will be recognized as numbers and not
  as strings:
  
      my $int = 23;
      say "int: $int"; # $int will now also have a PV flag
  
  That means that if you accidentally use a string in numeric context, it will
  also be recognized as a number:
  
      my $string = "23";
      my $something = $string + 0;
      print $yp->dump_string($string);
      # will be emitted as an integer without quotes!
  
  The layout is like libyaml output:
  
      key:
      - a
      - b
      - c
      ---
      - key1: 1
        key2: 2
        key3: 3
      ---
      - - a1
        - a2
      - - b1
        - b2
  
  =head1 WHY
  
  All the available parsers and loaders for Perl are behaving differently,
  and more important, aren't conforming to the spec. L<YAML::XS> is
  doing pretty well, but C<libyaml> only handles YAML 1.1 and diverges
  a bit from the spec. The pure perl loaders lack support for a number of
  features.
  
  I was going over L<YAML>.pm issues end of 2016, integrating old patches
  from rt.cpan.org and creating some pull requests myself. I realized
  that it would be difficult to patch YAML.pm to parse YAML 1.1 or even 1.2,
  and it would also break existing usages relying on the current behaviour.
  
  
  In 2016 Ingy döt Net initiated two really cool projects:
  
  =over 4
  
  =item L<"YAML TEST SUITE">
  
  =item L<"YAML EDITOR">
  
  =back
  
  These projects are a big help for any developer. So I got the idea
  to write my own parser and started on New Year's Day 2017.
  Without the test suite and the editor I would have never started this.
  
  I also started another YAML Test project which allows one to get a quick
  overview of which frameworks support which YAML features:
  
  =over 4
  
  =item L<"YAML TEST MATRIX">
  
  =back
  
  =head2 YAML TEST SUITE
  
  L<https://github.com/yaml/yaml-test-suite>
  
  It contains about 230 test cases and expected parsing events and more.
  There will be more tests coming. This test suite allows you to write parsers
  without turning the examples from the Specification into tests yourself.
  Also the examples aren't completely covering all cases - the test suite
  aims to do that.
  
  The suite contains .tml files, and in a separate 'data' release you will
  find the content in separate files, if you can't or don't want to
  use TestML.
  
  Thanks also to Felix Krause, who is writing a YAML parser in Nim.
  He turned all the spec examples into test cases.
  
  =head2 YAML EDITOR
  
  This is a tool to play around with several YAML parsers and loaders in vim.
  
  L<https://github.com/yaml/yaml-editor>
  
  The project contains the code to build the frameworks (16 as of this
  writing) and put it into one big Docker image.
  
  It also contains the yaml-editor itself, which will start a vim in the docker
  container. It uses a lot of funky vimscript that makes playing with it easy
  and useful. You can choose which frameworks you want to test and see the
  output in a grid of vim windows.
  
  Especially when writing a parser it is extremely helpful to have all
  the test cases and be able to play around with your own examples to see
  how they are handled.
  
  =head2 YAML TEST MATRIX
  
  I was curious to see how the different frameworks handle the test cases,
  so, using the test suite and the docker image, I wrote some code that runs
  the tests, manipulates the output to compare it with the expected output,
  and created a matrix view.
  
  L<https://github.com/perlpunk/yaml-test-matrix>
  
  You can find the latest build at L<https://matrix.yaml.io>
  
  As of this writing, the test matrix only contains valid test cases.
  Invalid ones will be added.
  
  =head1 CONTRIBUTORS
  
  =over
  
  =item Ingy döt Net
  
  Ingy is one of the creators of YAML. In 2016 he started the YAML Test Suite
  and the YAML Editor. He also made useful suggestions on the class
  hierarchy of YAML::PP.
  
  =item Felix "flyx" Krause
  
  Felix answered countless questions about the YAML Specification.
  
  =back
  
  =head1 SEE ALSO
  
  =over
  
  =item L<YAML>
  
  =item L<YAML::XS>
  
  =item L<YAML::Syck>
  
  =item L<YAML::Tiny>
  
  =item L<YAML::PP::LibYAML>
  
  =item L<YAML::LibYAML::API>
  
  =item L<https://www.yaml.info>
  
  =back
  
  =head1 SPONSORS
  
  The Perl Foundation L<https://www.perlfoundation.org/> sponsored this project
  (and the YAML Test Suite) with a grant of 2500 USD in 2017-2018.
  
  =head1 COPYRIGHT AND LICENSE
  
  Copyright 2017-2020 by Tina Müller
  
  This library is free software and may be distributed under the same terms
  as perl itself.
  
  =cut



( run in 0.805 second using v1.01-cache-2.11-cpan-e1769b4cff6 )