Skip to content

Commit

Permalink
actually enable xor; enable eq_i and ne_i (== and !=)
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed Jul 16, 2019
1 parent d4b4138 commit 8e8a1bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/App/MoarVM/ConfprogCompiler/Compiler.pm6
Expand Up @@ -272,7 +272,7 @@ multi sub compile_node(Op $op, :$target) {
$*REGALLOC.release($targetreg)
}
}
when any(<eq_s ne_s add_i sub_i mul_i div_i band_i bor_i bxor_i>) {
when any(<eq_s ne_s eq_i ne_i add_i sub_i mul_i div_i band_i bor_i bxor_i>) {
my $lhs = $op.children[0];
my $rhs = $op.children[1];

Expand Down
3 changes: 3 additions & 0 deletions lib/App/MoarVM/ConfprogCompiler/Parser/Grammar.pm6
Expand Up @@ -103,6 +103,9 @@ grammar ConfProg {
| '||'
| "and"
| "or"
| "xor"
| "=="
| "!="
]
}

Expand Down
2 changes: 1 addition & 1 deletion lib/App/MoarVM/ConfprogCompiler/Typesystem/Unifier.pm6
Expand Up @@ -54,7 +54,7 @@ multi sub unify_type(Op $node) {
die "rhs of string op must be stringy" unless $rhs.type.stringy;
$node.type = CPInt;
}
when any(<band_i bor_i bxor_i add_i sub_i mul_i div_i>) {
when any(<band_i bor_i bxor_i add_i sub_i mul_i div_i eq_i ne_i>) {
my $lhs = $node.children[0];
my $rhs = $node.children[1];

Expand Down

0 comments on commit 8e8a1bd

Please sign in to comment.