From 151fa123d861a5327073000491c8ef532a6f144c Mon Sep 17 00:00:00 2001 From: Jeff Ober Date: Fri, 17 Jan 2020 12:21:37 -0500 Subject: [PATCH] Update docs --- README.pod | 40 +++++++++++++++++++++++++++++++++++----- lib/TOML/Tiny.pm | 40 +++++++++++++++++++++++++++++++++++----- 2 files changed, 70 insertions(+), 10 deletions(-) diff --git a/README.pod b/README.pod index ff07a47..8abc798 100644 --- a/README.pod +++ b/README.pod @@ -36,8 +36,9 @@ version 0.01 =head1 DESCRIPTION C implements a pure-perl parser and generator for the -L data format. It conforms to TOML -v5.0. +L data format. It conforms to TOML v5 +(with a few caveats; see L) with support for more recent +changes in pursuit of v6. C strives to maintain an interface compatible to the L and L modules, and could even be used to override C<$TOML::Parser>: @@ -150,11 +151,40 @@ an array of mixed types if C was set. Alias for C to provide compatibility with C when overriding the parser by setting C<$TOML::Parser>. -=head1 DIFFERENCES FROM TOML AND TOML::Parser +=head1 DIFFERENCES FROM L AND L + +C differs in a few significant ways from the L module, +particularly in adding support for newer C features and strictness. L defaults to lax parsing and provides C to (slightly) -tighten things up. C defaults to strict parsing, with the exception -of optionally setting C. +tighten things up. C defaults to (somehwat) stricter parsing, with +the exception of permitting heterogenous arrays (illegal in v4 and v5, but +permissible in the upcoming v6); optional enforcement of homogenous arrays is +supported with C. + +C ignores invalid surrogate pairs within basic and multiline +strings (L may attempt to decode an invalid pair). Additionally, only +those character escapes officially supported by TOML are interpreted as such by +C. + +C supports stripping initial whitespace and handles lines +terminating with a backslash correctly in multilne strings: + + # TOML input + x=""" + foo""" + + y="""\ + how now \ + brown \ + bureaucrat.\ + """ + + # Perl output + {x => 'foo', y => 'how now brown bureaucrat.'} + +C includes support for integers specified in binary, octal or hex +as well as the special float values C and C. =head1 ACKNOWLEDGEMENTS diff --git a/lib/TOML/Tiny.pm b/lib/TOML/Tiny.pm index 26e8117..68983d2 100644 --- a/lib/TOML/Tiny.pm +++ b/lib/TOML/Tiny.pm @@ -92,8 +92,9 @@ sub parse { =head1 DESCRIPTION C implements a pure-perl parser and generator for the -L data format. It conforms to TOML -v5.0. +L data format. It conforms to TOML v5 +(with a few caveats; see L) with support for more recent +changes in pursuit of v6. C strives to maintain an interface compatible to the L and L modules, and could even be used to override C<$TOML::Parser>: @@ -209,11 +210,40 @@ Alias for C to provide compatibility with C when overriding the parser by setting C<$TOML::Parser>. -=head1 DIFFERENCES FROM TOML AND TOML::Parser +=head1 DIFFERENCES FROM L AND L + +C differs in a few significant ways from the L module, +particularly in adding support for newer C features and strictness. L defaults to lax parsing and provides C to (slightly) -tighten things up. C defaults to strict parsing, with the exception -of optionally setting C. +tighten things up. C defaults to (somehwat) stricter parsing, with +the exception of permitting heterogenous arrays (illegal in v4 and v5, but +permissible in the upcoming v6); optional enforcement of homogenous arrays is +supported with C. + +C ignores invalid surrogate pairs within basic and multiline +strings (L may attempt to decode an invalid pair). Additionally, only +those character escapes officially supported by TOML are interpreted as such by +C. + +C supports stripping initial whitespace and handles lines +terminating with a backslash correctly in multilne strings: + + # TOML input + x=""" + foo""" + + y="""\ + how now \ + brown \ + bureaucrat.\ + """ + + # Perl output + {x => 'foo', y => 'how now brown bureaucrat.'} + +C includes support for integers specified in binary, octal or hex +as well as the special float values C and C. =head1 ACKNOWLEDGEMENTS -- 2.30.2