]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blobdiff - Plugin.pod
Remove trailing whitespace
[perl/modules/re-engine-Plugin.git] / Plugin.pod
index 137199c10c43926c405946dadc26544a6a7065d6..4eefacc73fb7943a696f4d0ea8c8853f001b7da3 100644 (file)
@@ -2,6 +2,10 @@
 
 re::engine::Plugin - API to write custom regex engines
 
+=head1 VERSION
+
+Version 0.09
+
 =head1 DESCRIPTION
 
 As of perl 5.9.5 it's possible to lexically replace perl's built-in
@@ -122,6 +126,9 @@ available as the second argument (C<$str>) and through the L<str|/str>
 method. The routine should return a true value if the match was
 successful, and a false one if it wasn't.
 
+This callback can also be specified on an individual basis with the
+L</callbacks> method.
+
 =head1 METHODS
 
 =head2 str
@@ -182,6 +189,33 @@ called at all.
 The length specified will be used as a a byte length (using
 L<SvPV|perlapi/SvPV>), not a character length.
 
+=head2 nparens
+
+=head2 gofs
+
+=head2 callbacks
+
+    # A dumb regexp engine that just tests string equality
+    use re::engine::Plugin comp => sub {
+        my ($re) = @_;
+
+        my $pat = $re->pattern;
+
+        $re->callbacks(
+            exec => sub {
+                my ($re, $str) = @_;
+                return $pat eq $str;
+            },
+        );
+    };
+
+Takes a list of key-value pairs of names and subroutines, and replace the
+callback currently attached to the regular expression for the type given as
+the key by the code reference passed as the corresponding value.
+
+The only valid key is currently C<exec>. See L</exec> for more details about
+this callback.
+
 =head2 num_captures
 
     $re->num_captures(
@@ -231,7 +265,20 @@ done it'll allow the binding of C<%+> and C<%-> and support the
 L<Tie::Hash> methods FETCH, STORE, DELETE, CLEAR, EXISTS, FIRSTKEY,
 NEXTKEY and SCALAR.
 
-=head1 Tainting
+=head1 CONSTANTS
+
+=head2 C<REP_THREADSAFE>
+
+True iff the module could have been built with thread-safety features
+enabled.
+
+=head2 C<REP_FORKSAFE>
+
+True iff this module could have been built with fork-safety features
+enabled. This will always be true except on Windows where it's false
+for perl 5.10.0 and below.
+
+=head1 TAINTING
 
 The only way to untaint an existing variable in Perl is to use it as a
 hash key or referencing subpatterns from a regular expression match
@@ -292,7 +339,7 @@ this module is responsible for how and if it untaints its variables.
 
 L<perlreapi>, L<Taint::Util>
 
-=head1 TODO / CAVEATS
+=head1 TODO & CAVEATS
 
 I<here be dragons>
 
@@ -385,6 +432,15 @@ tests.
 
 =back
 
+=head1 DEPENDENCIES
+
+L<perl> 5.10.
+
+A C compiler.
+This module may happen to build with a C++ compiler as well, but don't rely on it, as no guarantee is made in this regard.
+
+L<XSLoader> (standard since perl 5.006).
+
 =head1 BUGS
 
 Please report any bugs that aren't already listed at
@@ -399,9 +455,9 @@ Vincent Pit C<< <perl at profvince.com> >>
 
 =head1 LICENSE
 
-Copyright 2007-2008 E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason.
+Copyright 2007,2008 E<AElig>var ArnfjE<ouml>rE<eth> Bjarmason.
 
-Copyright 2009 Vincent Pit.
+Copyright 2009,2010,2011 Vincent Pit.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.