arturo-lang / arturo

Simple, expressive & portable programming language for efficient scripting
http://arturo-lang.io
MIT License
716 stars 32 forks source link

[VM/values/operators] [`^^`] Verify for Web builds #1549

Open github-actions[bot] opened 9 months ago

github-actions[bot] commented 9 months ago

[VM/values/operators] [^^] Verify for Web builds we should also check whether big integers work too! (the same applies to its in-place equivalent)

https://github.com/arturo-lang/arturo/blob/04e57a1a8d6bcaf8fdb4003e0893ca35cc4ee90e/src/vm/values/operators.nim#L1291

            discard invalidOperation("or")

# TODO(VM/values/operators) [`^^`] Verify for Web builds
#  we should also check whether big integers work too!
#  (the same applies to its in-place equivalent)
#  labels: unit-test, web, :integer

proc `^^`*(x: Value, y: Value): Value =
    ## perform binary-XOR between given values and return the result

    let pair = getValuePair()
    case pair:
        of Integer    || Integer        :   return normalIntegerXor(x.i, y.i)
        of Integer    || BigInteger     :   (when defined(GMP): return newInteger(toBig(x.i) xor y.bi))
        of BigInteger || Integer        :   (when defined(GMP): return newInteger(x.bi xor toBig(y.i)))
        of BigInteger || BigInteger     :   (when defined(GMP): return newInteger(x.bi xor y.bi))
        of Integer    || Binary         :   return newBinary(numberToBinary(x.i) xor y.n)

        of Binary     || Integer        :   return newBinary(x.n xor numberToBinary(y.i))

d880cbc29bc024c46cb595062e3d5571468053f8

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.