perlpunk / YAML-PP-p5

A YAML 1.2 processor in perl
https://metacpan.org/pod/YAML::PP
24 stars 8 forks source link

Emitter formatting for boolean.pm values #25

Open ingydotnet opened 4 years ago

ingydotnet commented 4 years ago

YAML::XS style seems better.

★ ~/src/+pegex-parser/pegex-json-pm master $ perl -Mboolean -MYAML::PP -E 'say YAML::PP->new(schema => ['Perl'])->dump_string(true)'
--- !perl/scalar:boolean
=: 1

★ ~/src/+pegex-parser/pegex-json-pm master $ perl -Mboolean -MYAML::XS -E 'say YAML::XS::Dump(true)'
--- !!perl/scalar:boolean 1
ingydotnet commented 4 years ago
★ ~/src/+pegex-parser/pegex-json-pm master $ perl -Mboolean -MYAML::XS -E 'say YAML::XS::Dump(\\\1)'
--- !!perl/ref
=: !!perl/ref
  =: !!perl/ref
    =: 1

★ ~/src/+pegex-parser/pegex-json-pm master $ perl -Mboolean -MYAML::XS -E 'say YAML::XS::Dump(\true)'
--- !!perl/ref
=: !!perl/scalar:boolean 1

★ ~/src/+pegex-parser/pegex-json-pm master $ perl -Mboolean -MYAML::XS -E 'say YAML::XS::Dump(\\true)'
--- !!perl/ref
=: !!perl/ref
  =: !!perl/scalar:boolean 1