Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ng' of git@github.com:rakudo/rakudo into ng
- Loading branch information
Showing
9 changed files
with
103 additions
and
17 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
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
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,25 @@ | ||
=item !postcircumfix:<{ }> | ||
|
||
Because foreign (non-Rakudo) Parrot objects generally won't | ||
understand the "postcircumfix:<{ }>" method, we generate | ||
postcircumfix as a private call to this function, and this | ||
function then delegates to the appropriate method. For PMCs | ||
that don't have a postcircumfix:<{ }> method, we'll have to | ||
fake it later. | ||
=cut | ||
.namespace [] | ||
.sub '!postcircumfix:<{ }>' | ||
.param pmc invocant | ||
.param pmc args :slurpy | ||
$I0 = can invocant, 'postcircumfix:<{ }>' | ||
if $I0 goto object_method | ||
$I0 = isa invocant, 'Mu' | ||
if $I0 goto object_method | ||
foreign: | ||
die "Can't postcircumfix:<{ }> foreign objects yet." | ||
object_method: | ||
.tailcall invocant.'postcircumfix:<{ }>'(args :flat) | ||
.end | ||
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,22 @@ | ||
role EnumMap { | ||
has $!storage; | ||
|
||
method new(*%values) { | ||
self.bless(*, storage => pir::getattribute__PPs(%values, '$!storage')); | ||
} | ||
|
||
method postcircumfix:<{ }>($key) { | ||
Q:PIR { | ||
.local pmc self | ||
self = find_lex 'self' | ||
$P0 = getattribute self, '$!storage' | ||
$P1 = find_lex '$key' | ||
%r = $P0[$P1] | ||
unless null %r goto done | ||
%r = new ['Proxy'] | ||
setattribute %r, '$!base', $P0 | ||
setattribute %r, '$!key', $P1 | ||
done: | ||
} | ||
} | ||
} |
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,18 @@ | ||
role Hash is EnumMap { | ||
method postcircumfix:<{ }>($key) { | ||
Q:PIR { | ||
.local pmc self | ||
self = find_lex 'self' | ||
$P0 = getattribute self, '$!storage' | ||
$P1 = find_lex '$key' | ||
%r = $P0[$P1] | ||
unless null %r goto done | ||
%r = new ['Proxy'] | ||
setattribute %r, '$!base', $P0 | ||
setattribute %r, '$!key', $P1 | ||
$P2 = get_hll_global ['Bool'], 'True' | ||
setprop %r, 'rw', $P2 | ||
done: | ||
} | ||
} | ||
} |
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