Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stub in Capture, add capture and capterm in the grammar and actions f…
…or them, and add Parcel.Capture for coercing a Parcel to a Capture (capterm is implemented in terms of this; we need it anyway for other bits).
- Loading branch information
Showing
5 changed files
with
118 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
## $Id$ | ||
|
||
=head1 TITLE | ||
|
||
Capture - Perl 6 Capture class | ||
|
||
=head1 DESCRIPTION | ||
|
||
This file sets up the Perl 6 C<Capture> class. | ||
|
||
=cut | ||
|
||
.namespace ['Capture'] | ||
|
||
.sub 'onload' :anon :init :load | ||
.local pmc p6meta, captureproto | ||
p6meta = get_hll_global ['Mu'], '$!P6META' | ||
captureproto = p6meta.'new_class'('Capture', 'parent'=>'Any', 'attr'=>'$!pos $!named') | ||
.end | ||
|
||
|
||
=head2 Methods | ||
|
||
=over 4 | ||
|
||
=item new | ||
|
||
Takes a bunch of positional and named arguments and builds a capture from | ||
them. | ||
|
||
=cut | ||
|
||
.sub 'new' :method | ||
.param pmc pos_args :slurpy | ||
.param pmc named_args :slurpy :named | ||
|
||
# Create capture. | ||
$P0 = get_hll_global 'Whatever' | ||
$P0 = self.'bless'($P0, '$!pos'=>pos_args, '$!named'=>named_args) | ||
.return ($P0) | ||
.end | ||
|
||
=back | ||
|
||
=cut | ||
|
||
# Local Variables: | ||
# mode: pir | ||
# fill-column: 100 | ||
# End: | ||
# vim: expandtab shiftwidth=4 ft=pir: |
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