1 package TOML::Tiny::Util;
2 # ABSTRACT: utility functions used by TOML::Tiny
6 no warnings 'experimental';
9 use TOML::Tiny::Grammar;
11 use parent 'Exporter';
25 $type = 'array' when 'ARRAY';
26 $type = 'table' when 'HASH';
28 # Do a little heuristic guess-work
29 $type = 'float' when /Float/;
30 $type = 'integer' when /Int/;
31 $type = 'bool' when /Boolean/;
35 $type = 'bool' when /$Boolean/;
36 $type = 'float' when /$Float/;
37 $type = 'integer' when /$Integer/;
38 $type = 'datetime' when /$DateTime/;
39 default{ $type = 'string' };
54 return (undef, "expected value of type $t, but found $_")