Skip to content

Commit

Permalink
Add basic args handling to [regexp]
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Nov 30, 2009
1 parent 0241721 commit 8dbbda6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/PmTcl/Commands.pm
Expand Up @@ -271,7 +271,14 @@ our sub puts(*@args) {
'';
}

our sub regexp($exp, $string) {
our sub regexp(*@args) {
if +@args <2 {
error('wrong # args: should be "regexp ?switches? exp string ?matchVar? ?subMatchVar subMatchVar ...?"')
}

my $exp := @args.shift();
my $string := @args.shift();

## my &dumper := Q:PIR { %r = get_root_global ['parrot'], '_dumper' };
## &dumper(ARE::Compiler.compile($exp, :target<parse>));
my $regex := ARE::Compiler.compile($exp);
Expand Down

0 comments on commit 8dbbda6

Please sign in to comment.