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
Merge branch 'master' of git@github.com:rakudo/rakudo
- Loading branch information
Showing
14 changed files
with
213 additions
and
116 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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| 39025 | ||
| 39288 |
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,35 @@ | ||
| =begin pod | ||
| =head1 NAME | ||
| Safe - simplistic, crude Safe mode for Rakudo | ||
| =head1 Synopsis | ||
| BEGIN { @*INC.push: 'lib' } | ||
| use Safe; | ||
| # rest of your code here, which can't use | ||
| # run(), qx/../ or open() | ||
| # (at least not easily) | ||
| =head1 Description | ||
| C<Safe> crudely disables the most dangerous commands in Rakudo, right now | ||
| C<run()>, C<qx/.../> and the C<open()> function (opening sockets is still | ||
| allowed, though). Don't rely on it now, embedded PIR might still do very nasty | ||
| things. | ||
| =end pod | ||
|
|
||
| module Safe { | ||
| my $s = -> *@a, *%h { die "operation not permitted in safe mode" }; | ||
| Q:PIR { | ||
| $P0 = get_hll_namespace | ||
| $P1 = find_lex '$s' | ||
| $P0['run'] = $P1 | ||
| $P0['open'] = $P1 | ||
| $P0['!qx'] = $P1 | ||
| } | ||
| } | ||
| # 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
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,72 @@ | ||
| ## $Id$ | ||
|
|
||
| =head1 NAME | ||
|
|
||
| src/builtins/compiler.pir - various Perl6::Compiler methods | ||
|
|
||
| =head1 Methods | ||
|
|
||
| =over 4 | ||
|
|
||
| =cut | ||
|
|
||
| .namespace ['Perl6';'Compiler'] | ||
|
|
||
| .sub 'import' :method | ||
| .param pmc exportns | ||
| .param pmc symbols :slurpy | ||
| .param pmc options :slurpy :named | ||
|
|
||
| $P0 = self.'parse_name'(exportns) | ||
| exportns = get_hll_namespace $P0 | ||
| if null exportns goto end | ||
|
|
||
| .local pmc importns | ||
| importns = options['import_to'] | ||
| if null importns goto import_caller_ns | ||
| $P0 = self.'parse_name'(importns) | ||
| importns = get_hll_namespace $P0 | ||
| goto have_importns | ||
| import_caller_ns: | ||
| $P0 = getinterp | ||
| $P0 = $P0['sub';1] | ||
| importns = $P0.'get_namespace'() | ||
| have_importns: | ||
|
|
||
| .local pmc symbols_it | ||
| symbols_it = iter symbols | ||
| symbols_loop: | ||
| unless symbols_it goto symbols_done | ||
| .local string symtag | ||
| symtag = shift symbols_it | ||
| $S0 = substr symtag, 0, 1 | ||
| if $S0 == ':' goto symbols_tag | ||
| $P0 = exportns[$S0] | ||
| importns[$S0] = $P0 | ||
| goto symbols_loop | ||
|
|
||
| symbols_tag: | ||
| symtag = substr symtag, 1 | ||
| .local pmc tagns | ||
| tagns = exportns.'get_name'() | ||
| push tagns, 'EXPORT' | ||
| push tagns, symtag | ||
| tagns = get_root_namespace tagns | ||
| if null tagns goto tagns_done | ||
| .local pmc tagns_it | ||
| tagns_it = iter tagns | ||
| tagns_loop: | ||
| unless tagns_it goto tagns_done | ||
| $S0 = shift tagns_it | ||
| $P0 = tagns[$S0] | ||
| importns[$S0] = $P0 | ||
| goto tagns_loop | ||
| tagns_done: | ||
| goto symbols_loop | ||
| symbols_done: | ||
| end: | ||
| .end | ||
|
|
||
| =back | ||
|
|
||
| =cut |
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
Oops, something went wrong.