Skip to content
Browse files

Fix 2-arg rindex, thus fixing the rindex test failures in Rakudo.

  • Loading branch information...
1 parent e106957 commit ca9306c7ff2c39c9b3a082c77f498f8e627de06b @jnthn jnthn committed Jul 22, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/QAST/Operations.nqp
View
3 src/QAST/Operations.nqp
@@ -1203,10 +1203,11 @@ QAST::Operations.add_core_op('index', -> $qastcomp, $op {
!! QAST::Op.new( :op('indexfrom'), |@operands ));
});
QAST::Operations.add_core_pirop_mapping('rindexfrom', 'rindex', 'Issi');
+QAST::Operations.add_core_pirop_mapping('rindexfromend', 'rindex', 'Iss');
QAST::Operations.add_core_op('rindex', -> $qastcomp, $op {
my @operands := $op.list;
$qastcomp.as_post(+@operands == 2
- ?? QAST::Op.new( :op('rindexfrom'), |@operands, QAST::IVal.new( :value(0) ) )
+ ?? QAST::Op.new( :op('rindexfromend'), |@operands )
!! QAST::Op.new( :op('rindexfrom'), |@operands ));
});

0 comments on commit ca9306c

Please sign in to comment.
Something went wrong with that request. Please try again.