Skip to content

Instantly share code, notes, and snippets.

@timo
Created September 16, 2013 10:21
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/dc358f4f3999232f6303 to your computer and use it in GitHub Desktop.
Save timo/dc358f4f3999232f6303 to your computer and use it in GitHub Desktop.
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))
#);
#} 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