chiark / gitweb /
TOML::Tiny: Provide no_string_guessing
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 4 May 2020 00:13:41 +0000 (01:13 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 5 May 2020 20:10:56 +0000 (21:10 +0100)
commitdbb0699fd1e23c2eb747935973f278b83229959d
tree4c023c9dc5addb39dd5e9b62567523e9ded9169a
parentdab92c92905923c50929c14cc59adadff5b9eedf
TOML::Tiny: Provide no_string_guessing

Ideally, if we read a TOML file and write it back out again, we get a
semantically equivalent TOML file.  A necessary part of this is to
avoid the string-contents-based type-guessing.

Here, we provide a new `no_string_guessing` parameter which disables
this format-guessing.  Instead, it uses internal Perl flags to
distinguish integers from strings.

Right now this new feature is not likely to work for things that came
from TOML::Tiny::Parser without inflate_* parameters, since those are
all strings.  But it now allows Perl code to generate the TOML it
wants.
README.pod
lib/TOML/Tiny.pm
lib/TOML/Tiny/Writer.pm