While reading A05, I saw (and understand, perhaps more importantly)
some more interesting ways to try to abuse the :w modifier. Added tests
of forms of separating the modifier from the rest of the pattern:

  :w()foo ...
  :w[]foo ...
  :w\bfoo ...
  :w::foo ...

Pm: The :w()foo and :w[]foo for separating don't work. I got errors from
PGE::P6Rule starting with:

  got: 'invoke() not implemented in class 'Undef'

I'm guessing these grouping constructs aren't in there yet and commented
out those two tests with a note for now. Unless the () and [] should
actually be working. :)


-Dino

-- 
 .~.    Dino Morelli
 /V\    email: [EMAIL PROTECTED]
/( )\   weblog: http://categorically.net/d/blog/
^^-^^   preferred distro: Debian GNU/Linux  http://www.debian.org
Index: t/p6rules/ws.t
===================================================================
--- t/p6rules/ws.t      (revision 8105)
+++ t/p6rules/ws.t      (working copy)
@@ -1,6 +1,6 @@
 use strict;
 use warnings;
-use Parrot::Test tests => 15;
+use Parrot::Test tests => 17;
 use Parrot::Test::PGE;
 
 
@@ -23,6 +23,15 @@
 p6rule_is  ('foo-bar', ':w foo -? bar', 'basic ws match \s* \s*');
 p6rule_isnt('foobar', ':w foo -? bar', 'basic ws non-match');
 
+# with :w not separated by a space
+# XXX: These forms of modifier separation do not yet work
+#p6rule_is  ('foo - bar', ':w()foo -? bar', 'basic ws match');
+p6rule_is  ('foo - bar', ':w[]foo -? bar', 'basic ws match');
+p6rule_is  ('foo - bar', ':w\bfoo -? bar',
+    'basic ws match with boundary modifier separation');
+p6rule_is  ('foo - bar', ':w::foo -? bar',
+    'basic ws match with backtrack no-op modifier separation');
+
 # XXX: When available, add tests for full form :words modifier
 
-# dont forget to change the number of tests :-)
+# Don't forget to change the number of tests :-)

Reply via email to