Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
my class CallFrame { | ||
has Mu $!interp; | ||
has Int $.level; | ||
has %.annotations; | ||
has %.my; | ||
method new(Int :$level = 0) { | ||
my $l = $level + 1; | ||
my Mu $interp := pir::getinterp__P; | ||
my $self := nqp::create(CallFrame); | ||
nqp::bindattr($self, CallFrame, '$!interp', pir::getinterp__P); | ||
nqp::bindattr($self, CallFrame, '%!annotations', | ||
Q:PIR { | ||
.local pmc interp, annon | ||
.local int level | ||
interp = find_lex '$interp' | ||
$P0 = find_lex '$l' | ||
level = repr_unbox_int $P0 | ||
annon = interp["annotations"; level] | ||
%r = perl6ize_type annon | ||
} | ||
); | ||
my Mu $lexpad := Q:PIR { | ||
.local pmc interp | ||
.local int level | ||
interp = find_lex '$interp' | ||
$P0 = find_lex '$l' | ||
level = $P0 | ||
# no idea why we need this: | ||
%r = interp["lexpad"; level] | ||
}; | ||
my $h := nqp::create(EnumMap); | ||
nqp::bindattr($h, EnumMap, '$!storage', $lexpad); | ||
nqp::bindattr($self, CallFrame, '%!my', $h); | ||
|
||
$self; | ||
} | ||
|
||
method line() { | ||
%.annotations<line>; | ||
} | ||
method file() { | ||
%.annotations<file>; | ||
} | ||
|
||
method callframe(Int $level = 0) { | ||
die "not yet implemented"; | ||
} | ||
} | ||
|
||
sub callframe(Int $level = 0) { | ||
CallFrame.new(level => ($level + 1)); | ||
} | ||
|
||
# vim: ft=perl6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters