Skip to content

Commit a01efec

Browse files
committed
Replace some Q:PIR with the various new ops.
1 parent f80be32 commit a01efec

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

src/HLL/Compiler.pm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,7 @@ class HLL::Compiler {
174174
}
175175

176176
method ctxsave() {
177-
$*MAIN_CTX :=
178-
Q:PIR {
179-
$P0 = getinterp
180-
%r = $P0['context';1]
181-
};
177+
$*MAIN_CTX := nqp::ctxcaller(nqp::ctx());
182178
$*CTXSAVE := 0;
183179
}
184180

src/HLL/Grammar.pm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,7 @@ of the match.
323323

324324
method FAILGOAL($goal, $dba?) {
325325
unless $dba {
326-
$dba := ~Q:PIR{
327-
%r = getinterp
328-
%r = %r['sub';1]
329-
};
326+
$dba := ~nqp::callercode();
330327
}
331328
self.panic("Unable to parse expression in $dba; couldn't find final $goal");
332329
}

src/ModuleLoader.pm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ knowhow ModuleLoader {
3232
}
3333

3434
method ctxsave() {
35-
$*MAIN_CTX :=
36-
Q:PIR {
37-
$P0 = getinterp
38-
%r = $P0['context';1]
39-
};
35+
$*MAIN_CTX := nqp::ctxcaller(nqp::ctx());
4036
$*CTXSAVE := 0;
4137
}
4238

src/QRegex/Cursor.nqp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ role NQPCursorRole is export {
8282

8383
method !cursor_start() {
8484
my $new := nqp::create(self);
85-
my $sub := Q:PIR {
86-
$P0 = getinterp
87-
%r = $P0['sub';1]
88-
};
85+
my $sub := nqp::callercode();
8986
nqp::bindattr($new, $?CLASS, '$!orig', $!orig);
9087
nqp::bindattr($new, $?CLASS, '$!regexsub', nqp::ifnull(nqp::getcodeobj($sub), $sub));
9188
if nqp::defined($!restart) {
@@ -465,10 +462,7 @@ role NQPCursorRole is export {
465462

466463
method FAILGOAL($goal, $dba?) {
467464
unless $dba {
468-
$dba := ~Q:PIR{
469-
%r = getinterp
470-
%r = %r['sub';1]
471-
};
465+
$dba := ~nqp::callercode();
472466
}
473467
nqp::die("Unable to parse expression in $dba; couldn't find final $goal");
474468
}

0 commit comments

Comments
 (0)