Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
[nqp]: Bootstrap intermediate step
Browse files Browse the repository at this point in the history
Because sub definitions change from package to lexical in the
new version of nqp, move the private subs to the top so they
work in both old and new versions of nqp.  nqp-self target
passes all nqp tests.
  • Loading branch information
pmichaud committed Oct 28, 2009
1 parent 42e99a3 commit 42ff618
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/NQP/Actions.pm
Expand Up @@ -21,6 +21,26 @@ sub INIT() {
NQP::Grammar.O(':prec<f=>, :assoc<list>', '%list_infix');
}

sub xblock_immediate($xblock) {
$xblock[1] := block_immediate($xblock[1]);
$xblock;
}

sub block_immediate($block) {
$block.blocktype('immediate');
unless $block.symtable() {
my $stmts := PAST::Stmts.new( :node($block) );
for $block.list { $stmts.push($_); }
$block := $stmts;
}
$block;
}

sub sigiltype($sigil) {
$sigil eq '%'
?? 'Hash'
!! ($sigil eq '@' ?? 'ResizablePMCArray' !! 'Undef');
}

method TOP($/) { make $<comp_unit>.ast; }

Expand Down Expand Up @@ -516,23 +536,3 @@ method postfix:sym<-->($/) {
:pasttype('inline') );
}

sub xblock_immediate($xblock) {
$xblock[1] := block_immediate($xblock[1]);
$xblock;
}

sub block_immediate($block) {
$block.blocktype('immediate');
unless $block.symtable() {
my $stmts := PAST::Stmts.new( :node($block) );
for $block.list { $stmts.push($_); }
$block := $stmts;
}
$block;
}

sub sigiltype($sigil) {
$sigil eq '%'
?? 'Hash'
!! ($sigil eq '@' ?? 'ResizablePMCArray' !! 'Undef');
}

0 comments on commit 42ff618

Please sign in to comment.