From b8068e8d052b8136896ca76aee87a3e63722b4aa Mon Sep 17 00:00:00 2001 From: Kobi Gurkan Date: Sat, 11 May 2019 19:51:30 +0300 Subject: [PATCH] fix: changes ^ to do xor --- parser/jaz.jison | 2 +- parser/jaz.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parser/jaz.jison b/parser/jaz.jison index 7fd7089..52bd166 100644 --- a/parser/jaz.jison +++ b/parser/jaz.jison @@ -514,7 +514,7 @@ e12 : e12 '^' e11 { if (($1.type == "NUMBER") && ($3.type == "NUMBER")) { - $$ = { type: "NUMBER", value: $1.value.or($3.value).and(__MASK__) }; + $$ = { type: "NUMBER", value: $1.value.xor($3.value).and(__MASK__) }; } else { $$ = { type: "OP", op: "^", values: [$1, $3] }; } diff --git a/parser/jaz.js b/parser/jaz.js index 60c32fa..1d202be 100644 --- a/parser/jaz.js +++ b/parser/jaz.js @@ -361,7 +361,7 @@ break; case 59: if (($$[$0-2].type == "NUMBER") && ($$[$0].type == "NUMBER")) { - this.$ = { type: "NUMBER", value: $$[$0-2].value.or($$[$0].value).and(__MASK__) }; + this.$ = { type: "NUMBER", value: $$[$0-2].value.xor($$[$0].value).and(__MASK__) }; } else { this.$ = { type: "OP", op: "^", values: [$$[$0-2], $$[$0]] }; }