Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Compilation of literal nodes ignored negate flag; fix this.
  • Loading branch information
jnthn committed Nov 20, 2011
1 parent a6a4c80 commit 98ef1a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/QAST/Compiler.nqp
Expand Up @@ -250,10 +250,11 @@ class QAST::Compiler is HLL::Compiler {
my $litconst := $node[0];
my $litlen := nqp::chars($litconst);
my $litpost := self.escape($litconst);
my $cmpop := $node.negate ?? 'eq' !! 'ne';
$ops.push_pirop('add', '$I11', %*REG<pos>, $litlen);
$ops.push_pirop('gt', '$I11', %*REG<eos>, %*REG<fail>);
$ops.push_pirop('substr', '$S10', %*REG<tgt>, %*REG<pos>, $litlen);
$ops.push_pirop('ne', '$S10', $litpost, %*REG<fail>);
$ops.push_pirop($cmpop, '$S10', $litpost, %*REG<fail>);
$ops.push_pirop('add', %*REG<pos>, $litlen);
$ops;
}
Expand Down

0 comments on commit 98ef1a1

Please sign in to comment.