chiark / gitweb /
Add ABSTRACT for all modules, document TOML::Tiny::Grammar
authorJeff Ober <jober@ziprecruiter.com>
Mon, 13 Jan 2020 19:34:31 +0000 (14:34 -0500)
committerJeff Ober <jober@ziprecruiter.com>
Mon, 13 Jan 2020 19:34:31 +0000 (14:34 -0500)
README.pod
lib/TOML/Tiny/Grammar.pm
lib/TOML/Tiny/Parser.pm
lib/TOML/Tiny/Tokenizer.pm
lib/TOML/Tiny/Util.pm

index 7ef69a13022e86ee8ef8f69924d4565cf9d973ca..4faa974a2c9127c01837b588d843d9e1c5d73d83 100644 (file)
@@ -30,7 +30,8 @@ version 0.01
 
   # Object API
   my $parser = TOML::Tiny->new;
-  my $result = $parser->parse($toml);
+  my $data = $parser->decode($toml);
+  say $parser->encode($data);
 
 =head1 DESCRIPTION
 
@@ -151,7 +152,9 @@ overriding the parser by setting C<$TOML::Parser>.
 
 =head1 DIFFERENCES FROM TOML AND TOML::Parser MODULES
 
-=head1 TOML VERSION COMPATIBILITY
+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>.
 
 =head1 AUTHOR
 
index ff3a78132ef3f2d64e8dbb1b8e86e7875d21dc53..df365a9622c2e43e3d4fe6793e9f4f63ff27cb3a 100644 (file)
@@ -1,4 +1,5 @@
 package TOML::Tiny::Grammar;
+# ABSTRACT: exports regex definition of TOML grammar
 
 use strict;
 use warnings;
@@ -247,3 +248,44 @@ our $TOML = qr{
 }x;
 
 1;
+
+=head1 SYNOPSIS
+
+  use TOML::Tiny::Grammar;
+
+  if ($src =~ /(?&MultiLineString) $TOML/x) {
+    ...
+  }
+
+=head1 DESCRIPTION
+
+Exports C<$TOML>, a regex grammar for parsing TOML source.
+
+=head1 RULES
+
+=head2 (?&WS)
+=head2 (?&NL)
+=head2 (?&Comment)
+
+=head2 (?&Value)
+=head3 (?&Boolean)
+=head3 (?&DateTime)
+=head3 (?&Float)
+=head3 (?&Integer)
+=head3 (?&String)
+=head3 (?&Array)
+=head3 (?&InlineTable)
+
+=head2 (?&Key)
+=head3 (?&BareKey)
+=head3 (?&QuotedKey)
+=head3 (?&DottedKey)
+
+=head2 (?&ArrayOfTables)
+=head2 (?&KeyValuePair)
+=head2 (?&KeyValuePairDecl)
+=head2 (?&TableDecl)
+=head2 (?&Table)
+=head2 (?&Array)
+
+=cut
index e20a314c69f5bd68952f39e5d689a1cd6d499722..8da34eb7f03effc2de87e7f8a0c19605fceb3e02 100644 (file)
@@ -1,4 +1,5 @@
 package TOML::Tiny::Parser;
+# ABSTRACT: parser used by TOML::Tiny
 
 use strict;
 use warnings;
index 3ea9b3c243fe2f2968c2263f246093da0011323c..e3150bb23e00e7dbee15ee2aa69c3f5a701f19dc 100644 (file)
@@ -1,4 +1,5 @@
 package TOML::Tiny::Tokenizer;
+# ABSTRACT: tokenizer used by TOML::Tiny
 
 use strict;
 use warnings;
index c5fc35fab7d0b5dbbe09f4f713a60972d556fb88..c18af79cffad335323b20abbc9be65010466064c 100644 (file)
@@ -1,4 +1,5 @@
 package TOML::Tiny::Util;
+# ABSTRACT: utility functions used by TOML::Tiny
 
 use strict;
 use warnings;