Skip to content

Instantly share code, notes, and snippets.

@cygx

cygx/test.p6 Secret

Last active August 20, 2019 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cygx/b92999e516932a36b7ba7769c40f8a98 to your computer and use it in GitHub Desktop.
Save cygx/b92999e516932a36b7ba7769c40f8a98 to your computer and use it in GitHub Desktop.
use nqp;
use QAST:from<NQP>;
my $nul := nqp::null();
my $qcomp := nqp::getcomp('QAST');
my $mcomp := nqp::getcomp('MAST');
my $qcu := QAST::CompUnit.new();
my $sc := nqp::createsc('42');
$qcu.sc($sc);
nqp::setobjsc($nul, $sc);
nqp::scsetobj($sc, 0, $nul);
$qcu.set_children(nqp::list(
QAST::Block.new(
QAST::Op.new(:op<say>,
QAST::Op.new(:op<reprname>,
QAST::WVal.new(:value($nul))
)
)
)
));
#nqp::compunitmainline($mcomp.assemble_and_load($qcomp.to_mast($qcu))).();
$mcomp.assemble_to_file($qcomp.to_mast($qcu), 'dummy.moarvm');
# $ perl6 test.p6
# $ moar dummy.moarvm
# Unhandled exception: SC not yet resolved; lookup failed
# at <unknown>:1 (dummy.moarvm:)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment