chiark / gitweb /
Update docs
authorJeff Ober <jober@ziprecruiter.com>
Fri, 17 Jan 2020 17:21:37 +0000 (12:21 -0500)
committerJeff Ober <jober@ziprecruiter.com>
Fri, 17 Jan 2020 17:21:37 +0000 (12:21 -0500)
README.pod
lib/TOML/Tiny.pm

index ff07a472d911255d901761b1299ce760c2af6ac8..8abc7989b1a18795f87de5887a704f4d0b0f91a2 100644 (file)
@@ -36,8 +36,9 @@ version 0.01
 =head1 DESCRIPTION
 
 C<TOML::Tiny> implements a pure-perl parser and generator for the
-L<TOML|https://github.com/toml-lang/toml> data format. It conforms to TOML
-v5.0.
+L<TOML|https://github.com/toml-lang/toml> data format. It conforms to TOML v5
+(with a few caveats; see L</strict_arrays>) with support for more recent
+changes in pursuit of v6.
 
 C<TOML::Tiny> strives to maintain an interface compatible to the L<TOML> and
 L<TOML::Parser> modules, and could even be used to override C<$TOML::Parser>:
@@ -150,11 +151,40 @@ an array of mixed types if C<strict_arrays> was set.
 Alias for C<encode> to provide compatibility with C<TOML::Parser> when
 overriding the parser by setting C<$TOML::Parser>.
 
-=head1 DIFFERENCES FROM TOML AND TOML::Parser
+=head1 DIFFERENCES FROM L<TOML> AND L<TOML::Parser>
+
+C<TOML::Tiny> differs in a few significant ways from the L<TOML> module,
+particularly in adding support for newer C<TOML> features and strictness.
 
 L<TOML> defaults to lax parsing and provides C<strict_mode> to (slightly)
-tighten things up. C<TOML::Tiny> defaults to strict parsing, with the exception
-of optionally setting C<strict_arrays>.
+tighten things up. C<TOML::Tiny> 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<strict_arrays>.
+
+C<TOML::Tiny> ignores invalid surrogate pairs within basic and multiline
+strings (L<TOML> may attempt to decode an invalid pair). Additionally, only
+those character escapes officially supported by TOML are interpreted as such by
+C<TOML::Tiny>.
+
+C<TOML::Tiny> 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<TOML::Tiny> includes support for integers specified in binary, octal or hex
+as well as the special float values C<inf> and C<nan>.
 
 =head1 ACKNOWLEDGEMENTS
 
index 26e811754a906c9931cdae6fbc56bf4a444e8696..68983d2c5a4b66f6b8fcac78945131ed1e3912d7 100644 (file)
@@ -92,8 +92,9 @@ sub parse {
 =head1 DESCRIPTION
 
 C<TOML::Tiny> implements a pure-perl parser and generator for the
-L<TOML|https://github.com/toml-lang/toml> data format. It conforms to TOML
-v5.0.
+L<TOML|https://github.com/toml-lang/toml> data format. It conforms to TOML v5
+(with a few caveats; see L</strict_arrays>) with support for more recent
+changes in pursuit of v6.
 
 C<TOML::Tiny> strives to maintain an interface compatible to the L<TOML> and
 L<TOML::Parser> modules, and could even be used to override C<$TOML::Parser>:
@@ -209,11 +210,40 @@ Alias for C<encode> to provide compatibility with C<TOML::Parser> when
 overriding the parser by setting C<$TOML::Parser>.
 
 
-=head1 DIFFERENCES FROM TOML AND TOML::Parser
+=head1 DIFFERENCES FROM L<TOML> AND L<TOML::Parser>
+
+C<TOML::Tiny> differs in a few significant ways from the L<TOML> module,
+particularly in adding support for newer C<TOML> features and strictness.
 
 L<TOML> defaults to lax parsing and provides C<strict_mode> to (slightly)
-tighten things up. C<TOML::Tiny> defaults to strict parsing, with the exception
-of optionally setting C<strict_arrays>.
+tighten things up. C<TOML::Tiny> 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<strict_arrays>.
+
+C<TOML::Tiny> ignores invalid surrogate pairs within basic and multiline
+strings (L<TOML> may attempt to decode an invalid pair). Additionally, only
+those character escapes officially supported by TOML are interpreted as such by
+C<TOML::Tiny>.
+
+C<TOML::Tiny> 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<TOML::Tiny> includes support for integers specified in binary, octal or hex
+as well as the special float values C<inf> and C<nan>.
 
 =head1 ACKNOWLEDGEMENTS