Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[nrx] Reimplement $/ and $¢
  • Loading branch information
sorear committed Sep 6, 2010
1 parent 91d975d commit fe86829
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/Niecza/Actions.pm
Expand Up @@ -2,6 +2,7 @@ package Niecza::Actions;
use 5.010;
use strict;
use warnings;
use utf8;
use Scalar::Util 'blessed';

use Op;
Expand Down
15 changes: 8 additions & 7 deletions test2.pl
Expand Up @@ -145,13 +145,14 @@
# ok G7.parse('+'), "can parse :sym<> symbols";
# ok G7.parse('foo'), "can parse : symbols";
# }
#
# {
# ok 'xxy' ~~ /x { $a = $/.pos } /, "can match with \$/ stuff";
# is $a, 1, '$/.pos is the right sort of thing';
# 'xxy' ~~ /x { $a = ($¢ ~~ Cursor) }/;
# is $a, True, '$¢ isa Cursor';
# }

{
my $a;
ok 'xxy' ~~ /x { $a = $/.pos } /, "can match with \$/ stuff";
is $a, 1, '$/.pos is the right sort of thing';
'xxy' ~~ /x { $a = ($¢ ~~ Cursor) }/;
is $a, True, '$¢ isa Cursor';
}

#rxtest /x.y/, "x.y", ("xay", "x y"), ("xy", "xaay");
#rxtest /<!>/, '<!>', Nil, ("", "x");
Expand Down

0 comments on commit fe86829

Please sign in to comment.