[svn:parrot] r41333 - in trunk/runtime/parrot/library: PGE Tcl

coke at svn.parrot.org coke at svn.parrot.org
Fri Sep 18 12:57:54 UTC 2009


Author: coke
Date: Fri Sep 18 12:57:53 2009
New Revision: 41333
URL: https://trac.parrot.org/parrot/changeset/41333

Log:
Add some clarifying documentation to Tcl::Glob, and have each Glob style
refer to the other.

Modified:
   trunk/runtime/parrot/library/PGE/Glob.pir
   trunk/runtime/parrot/library/Tcl/Glob.pir

Modified: trunk/runtime/parrot/library/PGE/Glob.pir
==============================================================================
--- trunk/runtime/parrot/library/PGE/Glob.pir	Fri Sep 18 07:54:15 2009	(r41332)
+++ trunk/runtime/parrot/library/PGE/Glob.pir	Fri Sep 18 12:57:53 2009	(r41333)
@@ -7,7 +7,8 @@
 
 =head1 DESCRIPTION
 
-A parser for shell-stype glob notation.
+A parser for shell-stype glob notation. See C<Tcl::Glob> for a
+slightly different glob syntax.
 
 =head2 Functions
 

Modified: trunk/runtime/parrot/library/Tcl/Glob.pir
==============================================================================
--- trunk/runtime/parrot/library/Tcl/Glob.pir	Fri Sep 18 07:54:15 2009	(r41332)
+++ trunk/runtime/parrot/library/Tcl/Glob.pir	Fri Sep 18 12:57:53 2009	(r41333)
@@ -7,7 +7,33 @@
 
 =head1 DESCRIPTION
 
-A parser for Tcl-stype glob notation.
+A PGE-based parser for glob notation. See C<PGE::Glob> for a slightly
+different glob syntax.
+
+The following special characters are supported
+
+=over 4
+
+=item C<?>
+
+Matches any single character
+
+=item C<*>
+
+Matches any number of any characters, including no characters.
+
+=item C<[chars]>
+
+Matches any character in the given set. Sets are either a sequence of explicit
+characters, or a range specified with a dash, e.g. [aeiou] matches lower
+case ASCII vowels, while [a-z] matches any lowercase ASCII letter.
+
+=item C<\x>
+
+Match a literal character, e.g. \* matches the literal C<*>, avoiding its
+special meaning.
+
+=back
 
 =head2 Functions
 
@@ -376,6 +402,9 @@
 This is basically a cut and paste of PGE::Glob. There should probably be
 much less code duplication here.
 
+While originally implemented based on Tcl's C<[string match]> globbing
+syntax, this code is useful enough to be part of parrot's core.
+
 =head1 AUTHOR
 
 PGE::Glob was originally authored by Jonathan Scott Duff (duff at pobox.com),


More information about the parrot-commits mailing list