Skip to content

Commit bdab779

Browse files
committed
Add pastnode rxtype to QAST::Regex.
1 parent 051792c commit bdab779

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/QAST/Compiler.nqp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,18 @@ class QAST::Compiler is HLL::Compiler {
261261
$ops;
262262
}
263263

264+
method pastnode($node) {
265+
my $ops := self.post_new('Ops', :result(%*REG<cur>));
266+
$ops.push_pirop('repr_bind_attr_int', %*REG<cur>, %*REG<curclass>, '"$!pos"', %*REG<pos>);
267+
$ops.push_pirop('store_lex', 'unicode:"$\x{a2}"', %*REG<cur>);
268+
my $cpost := $*PASTCOMPILER.as_post($node[0], :rtype<P>);
269+
$ops.push($cpost);
270+
if $node.subtype eq 'zerowidth' {
271+
$ops.push_pirop($node.negate ?? 'if' !! 'unless', $cpost, %*REG<fail>);
272+
}
273+
$ops;
274+
}
275+
264276
method quant($node) {
265277
my $ops := self.post_new('Ops', :result(%*REG<cur>));
266278
my $backtrack := $node.backtrack || 'g';

0 commit comments

Comments
 (0)