Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
[p6regex]: Handle @modifier initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Oct 28, 2009
1 parent 775500b commit 6f44564
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Regex/P6Regex.pir
Expand Up @@ -36,6 +36,8 @@ Regex::P6Regex - Parser/compiler for Perl 6 regexes
p6regex.'parsegrammar'($P0)
$P0 = get_hll_global ['Regex';'P6Regex'], 'Actions'
p6regex.'parseactions'($P0)
$P0 = get_hll_global ['Regex';'P6Regex';'Actions'], 'INIT'
$P0()
.end
Expand Down
6 changes: 5 additions & 1 deletion src/Regex/P6Regex/Actions.pm
@@ -1,11 +1,15 @@
class Regex::P6Regex::Actions;

## this will eventually be handled using contextuals
our @MODIFIERS := Q:PIR {
our @MODIFIERS;

sub INIT() {
@MODIFIERS := Q:PIR {
%r = new ['ResizablePMCArray']
$P0 = new ['Hash']
push %r, $P0
};
}
method arg($/) {
make $<quote> ?? ~$<quote><val> !! +$<val>;
Expand Down

0 comments on commit 6f44564

Please sign in to comment.