Skip to content

Commit

Permalink
Add more PAST.
Browse files Browse the repository at this point in the history
  • Loading branch information
bacek committed Feb 22, 2011
1 parent 5209840 commit f34ceb1
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion compilers/opsc/src/Ops/Compiler/Actions.pm
Expand Up @@ -359,7 +359,7 @@ method blockoid ($/) {
my $past := PAST::Block.new(:node($/));

$past.push($_.ast) for $<declarator>;
$past.push($_.ast) for @($<statement_list>.ast);
$past.push($_) for @($<statement_list>.ast);

make $past;
}
Expand All @@ -377,9 +377,29 @@ method declarator ($/) {
method statement_list ($/) {
my $past := PAST::Stmts.new(:node($/));

$past.push($_.ast) for $<statement>;

make $past;
}

method statement ($/) {
my $past;

if $<statement_control> {
$past := $<statement_control>.ast;
}
elsif $<blockoid> {
$past := $<blockoid>.ast;
}
elsif $<EXPR> {
$past := $<EXPR>.ast;
}
else {
$/.CURSOR.panic("Unknown content in statement");
}

make $past;
}

# Local Variables:
# mode: perl6
Expand Down

0 comments on commit f34ceb1

Please sign in to comment.