Skip to content

Instantly share code, notes, and snippets.

@timo
Created September 15, 2013 21:47
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 timo/67bd469e5a2317046856 to your computer and use it in GitHub Desktop.
Save timo/67bd469e5a2317046856 to your computer and use it in GitHub Desktop.
what is this i don't even ...
QAST::Operations.add_core_op('bindattr_i', -> $qastcomp, $op {
if +@($op) != 4 {
nqp::die('bindattr_i requires four operands');
}
if $op[1].has_compile_time_value && $op[2].has_compile_time_value {
my $hint := -1;
$hint := pir::repr_hint_for__IPs($op[1].compile_time_value, $op[2].compile_time_value);
QAST::VM.new(
:pirop<repr_bind_attr_int__0PPSii>,
$op[0],
$op[1],
$op[2],
$op[3],
QAST::IVal(:value($hint))
);
$ops;
} else {
$qastcomp.as_post(QAST::VM.new(
:pirop<repr_bind_attr_int__0PPSi>,
$op[0],
$op[1],
$op[2],
$op[3]
))
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment