Browse Source

Merge pull request #30 from kobigurk/master

fix: fixes ^ to do xor
feature/witness_bin
Jordi Baylina 5 years ago
committed by GitHub
parent
commit
4a8bcff3da
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      parser/jaz.jison
  2. +1
    -1
      parser/jaz.js

+ 1
- 1
parser/jaz.jison

@ -514,7 +514,7 @@ e12
: e12 '^' e11 : e12 '^' e11
{ {
if (($1.type == "NUMBER") && ($3.type == "NUMBER")) { 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 { } else {
$$ = { type: "OP", op: "^", values: [$1, $3] }; $$ = { type: "OP", op: "^", values: [$1, $3] };
} }

+ 1
- 1
parser/jaz.js

@ -361,7 +361,7 @@ break;
case 59: case 59:
if (($$[$0-2].type == "NUMBER") && ($$[$0].type == "NUMBER")) { 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 { } else {
this.$ = { type: "OP", op: "^", values: [$$[$0-2], $$[$0]] }; this.$ = { type: "OP", op: "^", values: [$$[$0-2], $$[$0]] };
} }

Loading…
Cancel
Save