Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Move !op implementation functions from assign.pir to new metaops.pir.
- Loading branch information
Showing
3 changed files
with
43 additions
and
27 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| =head1 NAME | ||
|
|
||
| src/builtins/metaops.pir - meta-op operations | ||
|
|
||
| =head1 Functions | ||
|
|
||
| =over 2 | ||
|
|
||
| =cut | ||
|
|
||
| .sub '!gen_not_metaop' | ||
| .param string sym | ||
| .local string opname, metaname | ||
| $S0 = concat sym, '>' | ||
| opname = concat '&infix:<', $S0 | ||
| metaname = concat '&infix:<!', $S0 | ||
| $P0 = get_global metaname | ||
| unless null $P0 goto done | ||
| $P1 = box opname | ||
| .lex '$opname', $P1 | ||
| .const 'Sub' metasub = '!not_metaop' | ||
| $P0 = newclosure metasub | ||
| set_global metaname, $P0 | ||
| done: | ||
| .end | ||
|
|
||
| # XXX -- we might want this to be a Perl6MultiSub | ||
| .sub '!not_metaop' :anon :outer('!gen_not_metaop') | ||
| .param pmc a | ||
| .param pmc b | ||
| $P0 = find_lex '$opname' | ||
| $S0 = $P0 | ||
| $P0 = get_global $S0 | ||
| $P1 = $P0(a, b) | ||
| .tailcall '&prefix:<!>'($P1) | ||
| .end | ||
|
|
||
| # Local Variables: | ||
| # mode: pir | ||
| # fill-column: 100 | ||
| # End: | ||
| # vim: expandtab shiftwidth=4 ft=pir: |