Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
CompilerJAST needs a CompUnit, so use that for wrapping
  • Loading branch information
sorear committed Jun 7, 2013
1 parent cd4197e commit f88d35c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/vm/jvm/QAST/Compiler.nqp
Expand Up @@ -2612,9 +2612,12 @@ class QAST::CompilerJAST {
}

method jast($source, :$classname!, *%adverbs) {
# Wrap $source in a QAST::Block if it's not already a viable root node.
$source := QAST::Block.new($source)
unless nqp::istype($source, QAST::CompUnit) || nqp::istype($source, QAST::Block);
# Wrap $source in a QAST::CompUnit if it's not already a viable root node.
unless nqp::istype($source, QAST::CompUnit) {
my $unit := $source;
$unit := QAST::Block.new($unit) unless nqp::istype($unit, QAST::Block);
$source := QAST::CompUnit.new(:hll(''), $unit);
}

# Set up a JAST::Class that will hold all the blocks (which become Java
# methods) that we shall compile.
Expand Down

0 comments on commit f88d35c

Please sign in to comment.