Skip to content

Commit

Permalink
Initial version of importing setting exports into global namespace.
Browse files Browse the repository at this point in the history
Has a few problems dealing with multimethods -- will get jnthn++ to help.
  • Loading branch information
pmichaud committed Mar 2, 2009
1 parent 4fcd209 commit 0d369db
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions perl6.pir
Expand Up @@ -232,6 +232,41 @@ to the Perl 6 compiler.
.include 'src/gen_metaop.pir'
.include 'src/gen_junction.pir'

=item postload()

Perform any tasks that need to be done at the end of loading.
Currently this does the equivalent of EXPORTALL on the core namespaces.

=cut

.namespace []

.sub '' :anon :load :init
.local pmc perl6, nslist, nsiter
perl6 = get_hll_global ['Perl6'], 'Compiler'
nslist = split ' ', 'Any'
nsiter = iter nslist
ns_loop:
unless nsiter goto ns_done
$S0 = shift nsiter
$S0 .= '::EXPORT::ALL'
$P0 = perl6.'parse_name'($S0)
.local pmc ns, symiter
ns = get_hll_namespace $P0
if null ns goto ns_loop
symiter = iter ns
sym_loop:
unless symiter goto sym_done
$S0 = shift symiter
$P0 = ns[$S0]
set_global $S0, $P0
goto sym_loop
sym_done:
goto ns_loop
ns_done:
.end


# Local Variables:
# mode: pir
# fill-column: 100
Expand Down

0 comments on commit 0d369db

Please sign in to comment.