Skip to content

Commit f963eb2

Browse files
committed
Comparisons for revealed binary values.
1 parent d25ffeb commit f963eb2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Compiler/GC/types.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,12 @@ def __invert__(self):
390390
res = type(self)()
391391
inst.notcb(self.n, res, self)
392392
return res
393-
def __eq__(self, other):
394-
raise CompilerError('equality not implemented')
393+
__lt__ = lambda self, other: regint(self) < other
394+
__le__ = lambda self, other: regint(self) <= other
395+
__gt__ = lambda self, other: regint(self) > other
396+
__ge__ = lambda self, other: regint(self) >= other
397+
__eq__ = lambda self, other: regint(self) == other
398+
__ne__ = lambda self, other: regint(self) != other
395399
def print_reg(self, desc=''):
396400
inst.print_regb(self, desc)
397401
def print_reg_plain(self):

0 commit comments

Comments
 (0)