Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use nqp::getlexcaller op.
  • Loading branch information
jnthn committed Apr 10, 2013
1 parent 1ee3b4c commit 400fb2c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/core/Exception.pm
Expand Up @@ -51,7 +51,7 @@ my class Exception {
method fail(Exception:D:) {
try self.throw;
my $fail := Failure.new($!);
my Mu $return := pir::find_caller_lex__Ps('RETURN');
my Mu $return := nqp::getlexcaller('RETURN');
$return($fail) unless nqp::isnull($return);
$fail
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/Failure.pm
Expand Up @@ -47,7 +47,7 @@ my &fail := -> *@msg {
die $value if $*FATAL;
try die $value;
my $fail := Failure.new($!);
my Mu $return := pir::find_caller_lex__Ps('RETURN');
my Mu $return := nqp::getlexcaller('RETURN');
$return($fail) unless nqp::isnull($return);
$fail
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/Grammar.pm
@@ -1,13 +1,13 @@
my class Grammar is Cursor {
method parse($target, :$rule = 'TOP', Mu :$actions = Mu, *%opt) {
my $*ACTIONS = $actions;
pir::find_caller_lex__Ps('$/') =
nqp::getlexcaller('$/') =
self."!cursor_init"($target, |%opt)."$rule"().MATCH;
}
method parsefile(Cool $filename as Str, *%opts) {
my $fh := open($filename);
my $match := self.parse($fh.slurp, |%opts);
$fh.close;
pir::find_caller_lex__Ps('$/') = $match;
nqp::getlexcaller('$/') = $match;
}
}
4 changes: 2 additions & 2 deletions src/core/Match.pm
Expand Up @@ -82,13 +82,13 @@ my class Match is Capture is Cool {

sub make(Mu $ast) {
nqp::bindattr(
nqp::p6decont(pir::find_caller_lex__Ps('$/')),
nqp::p6decont(nqp::getlexcaller('$/')),
Match,
'$!ast',
$ast
);
nqp::bindattr(
nqp::p6decont(pir::find_caller_lex__Ps('$/').CURSOR),
nqp::p6decont(nqp::getlexcaller('$/').CURSOR),
Cursor,
'$!ast',
$ast
Expand Down
4 changes: 2 additions & 2 deletions src/core/Str.pm
Expand Up @@ -541,7 +541,7 @@ my class Str does Stringy {
:continue(:$c), :pos(:$p),
:global(:$g), :overlap(:$ov), :exhaustive(:$ex),
:st(:nd(:rd(:th(:$nth)))), :$x) {
my $caller_dollar_slash := pir::find_caller_lex__Ps('$/');
my $caller_dollar_slash := nqp::getlexcaller('$/');
my %opts;
if $p.defined { %opts<p> = $p }
else { %opts<c> = $c // 0; }
Expand Down Expand Up @@ -619,7 +619,7 @@ my class Str does Stringy {
multi method subst($matcher, $replacement,
:ii(:$samecase), :ss(:$samespace),
:$SET_CALLER_DOLLAR_SLASH, *%options) {
my $caller_dollar_slash := pir::find_caller_lex__Ps('$/');
my $caller_dollar_slash := nqp::getlexcaller('$/');
my $SET_DOLLAR_SLASH = $SET_CALLER_DOLLAR_SLASH || nqp::istype($matcher, Regex);
my @matches = self.match($matcher, |%options);
try $caller_dollar_slash = $/ if $SET_DOLLAR_SLASH;
Expand Down
4 changes: 2 additions & 2 deletions src/core/operators.pm
Expand Up @@ -189,7 +189,7 @@ sub undefine(Mu \x) {
}

sub prefix:<temp>(\cont) is rw {
my $temp_restore := pir::find_caller_lex__Ps('!TEMP-RESTORE');
my $temp_restore := nqp::getlexcaller('!TEMP-RESTORE');
my int $i = nqp::elems($temp_restore);
while $i > 0 {
$i = $i - 2;
Expand All @@ -214,7 +214,7 @@ sub prefix:<temp>(\cont) is rw {
}

sub prefix:<let>(\cont) is rw {
my $let_restore := pir::find_caller_lex__Ps('!LET-RESTORE');
my $let_restore := nqp::getlexcaller('!LET-RESTORE');
my int $i = nqp::elems($let_restore);
while $i > 0 {
$i = $i - 2;
Expand Down
2 changes: 1 addition & 1 deletion src/core/terms.pm
Expand Up @@ -48,7 +48,7 @@ sub term:<time>() { nqp::p6box_i(nqp::time_i()) }
}
nqp::bindkey(nqp::who(PROCESS), '$VM', $VM);

my Mu $compiler := pir::find_caller_lex__PS('$COMPILER_CONFIG');
my Mu $compiler := nqp::getlexcaller('$COMPILER_CONFIG');
my $PERL = {
name => 'rakudo',
compiler => {
Expand Down
2 changes: 1 addition & 1 deletion tools/build/NQP_REVISION
@@ -1 +1 @@
2013.03-10-ge92eff1
2013.03-11-g788df18

0 comments on commit 400fb2c

Please sign in to comment.