Skip to content

Commit 9a2b3df

Browse files
lyubomyr-shaydarivsrh
authored andcommitted
Implement bitwise operations
- Core server implementation - ReQL docs - Support in the Java, JavaScript, Python, and Ruby drivers
1 parent 7668ec0 commit 9a2b3df

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

ast.coffee

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ class RDBVal extends TermBase
136136
mul: (args...) -> new Mul {}, @, args...
137137
div: (args...) -> new Div {}, @, args...
138138
mod: (args...) -> new Mod {}, @, args...
139+
bitAnd: (args...) -> new BitAnd {}, @, args...
140+
bitOr: (args...) -> new BitOr {}, @, args...
141+
bitXor: (args...) -> new BitXor {}, @, args...
142+
bitNot: (args...) -> new BitNot {}, @, args...
143+
bitSal: (args...) -> new BitSal {}, @, args...
144+
bitSar: (args...) -> new BitSar {}, @, args...
139145
floor: (args...) -> new Floor {}, @, args...
140146
ceil: (args...) -> new Ceil {}, @, args...
141147
round: (args...) -> new Round {}, @, args...
@@ -657,6 +663,30 @@ class Mod extends RDBOp
657663
tt: protoTermType.MOD
658664
mt: 'mod'
659665

666+
class BitAnd extends RDBOp
667+
tt: protoTermType.BIT_AND
668+
mt: 'bitAnd'
669+
670+
class BitOr extends RDBOp
671+
tt: protoTermType.BIT_OR
672+
mt: 'bitOr'
673+
674+
class BitXor extends RDBOp
675+
tt: protoTermType.BIT_XOR
676+
mt: 'bitXor'
677+
678+
class BitNot extends RDBOp
679+
tt: protoTermType.BIT_NOT
680+
mt: 'bitNot'
681+
682+
class BitSal extends RDBOp
683+
tt: protoTermType.BIT_SAL
684+
mt: 'bitSal'
685+
686+
class BitSar extends RDBOp
687+
tt: protoTermType.BIT_SAR
688+
mt: 'bitSar'
689+
660690
class Floor extends RDBOp
661691
tt: protoTermType.FLOOR
662692
mt: 'floor'
@@ -1323,6 +1353,12 @@ rethinkdb.sub = (args...) -> new Sub {}, args...
13231353
rethinkdb.div = (args...) -> new Div {}, args...
13241354
rethinkdb.mul = (args...) -> new Mul {}, args...
13251355
rethinkdb.mod = (args...) -> new Mod {}, args...
1356+
rethinkdb.bitAnd = (args...) -> new BitAnd {}, args...
1357+
rethinkdb.bitOr = (args...) -> new BitOr {}, args...
1358+
rethinkdb.bitXor = (args...) -> new BitXor {}, args...
1359+
rethinkdb.bitNot = (args...) -> new BitNot {}, args...
1360+
rethinkdb.bitSal = (args...) -> new BitSal {}, args...
1361+
rethinkdb.bitSar = (args...) -> new BitSar {}, args...
13261362
rethinkdb.floor = (args...) -> new Floor {}, args...
13271363
rethinkdb.ceil = (args...) -> new Ceil {}, args...
13281364
rethinkdb.round = (args...) -> new Round {}, args...

0 commit comments

Comments
 (0)