fhdl/structure: add unary minus

This commit is contained in:
Sebastien Bourdeauducq 2012-11-29 22:52:57 +01:00
parent d8e478efee
commit 55d143a454
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,8 @@ class HUID:
class Value(HUID): class Value(HUID):
def __invert__(self): def __invert__(self):
return _Operator("~", [self]) return _Operator("~", [self])
def __neg__(self):
return _Operator("-", [self])
def __add__(self, other): def __add__(self, other):
return _Operator("+", [self, other]) return _Operator("+", [self, other])