From 0ef310b7d9a3bf02b6caf54ba20982640e48156a Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Thu, 7 Feb 2019 20:48:16 -0600 Subject: And/or/xor for enums --- nimterop/types.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nimterop/types.nim b/nimterop/types.nim index ecc5345..17b4795 100644 --- a/nimterop/types.nim +++ b/nimterop/types.nim @@ -58,4 +58,16 @@ template defineEnum*(typ) = proc `shr`*(x: int, y: typ): typ {.borrow.} proc `shr`*(x, y: typ): typ {.borrow.} + proc `or`*(x: typ, y: int): typ {.borrow.} + proc `or`*(x: int, y: typ): typ {.borrow.} + proc `or`*(x, y: typ): typ {.borrow.} + + proc `and`*(x: typ, y: int): typ {.borrow.} + proc `and`*(x: int, y: typ): typ {.borrow.} + proc `and`*(x, y: typ): typ {.borrow.} + + proc `xor`*(x: typ, y: int): typ {.borrow.} + proc `xor`*(x: int, y: typ): typ {.borrow.} + proc `xor`*(x, y: typ): typ {.borrow.} + proc `$` *(x: typ): string {.borrow.} \ No newline at end of file -- cgit v1.2.3