Fix typo shift operator

pull/191/head
Josselin 6 years ago
parent d6806f0763
commit c197f5dc7b
  1. 6
      slither/core/expressions/binary_operation.py
  2. 6
      slither/slithir/operations/binary.py
  3. 2
      slither/visitors/slithir/expression_to_slithir.py

@ -13,7 +13,7 @@ class BinaryOperationType:
ADDITION = 4 # + ADDITION = 4 # +
SUBTRACTION = 5 # - SUBTRACTION = 5 # -
LEFT_SHIFT = 6 # << LEFT_SHIFT = 6 # <<
RIGHT_SHIT = 7 # >>> RIGHT_SHIFT = 7 # >>>
AND = 8 # & AND = 8 # &
CARET = 9 # ^ CARET = 9 # ^
OR = 10 # | OR = 10 # |
@ -43,7 +43,7 @@ class BinaryOperationType:
if operation_type == '<<': if operation_type == '<<':
return BinaryOperationType.LEFT_SHIFT return BinaryOperationType.LEFT_SHIFT
if operation_type == '>>': if operation_type == '>>':
return BinaryOperationType.RIGHT_SHIT return BinaryOperationType.RIGHT_SHIFT
if operation_type == '&': if operation_type == '&':
return BinaryOperationType.AND return BinaryOperationType.AND
if operation_type == '^': if operation_type == '^':
@ -86,7 +86,7 @@ class BinaryOperationType:
return '-' return '-'
if operation_type == BinaryOperationType.LEFT_SHIFT: if operation_type == BinaryOperationType.LEFT_SHIFT:
return '<<' return '<<'
if operation_type == BinaryOperationType.RIGHT_SHIT: if operation_type == BinaryOperationType.RIGHT_SHIFT:
return '>>' return '>>'
if operation_type == BinaryOperationType.AND: if operation_type == BinaryOperationType.AND:
return '&' return '&'

@ -14,7 +14,7 @@ class BinaryType(object):
ADDITION = 4 # + ADDITION = 4 # +
SUBTRACTION = 5 # - SUBTRACTION = 5 # -
LEFT_SHIFT = 6 # << LEFT_SHIFT = 6 # <<
RIGHT_SHIT = 7 # >> RIGHT_SHIFT = 7 # >>
AND = 8 # & AND = 8 # &
CARET = 9 # ^ CARET = 9 # ^
OR = 10 # | OR = 10 # |
@ -55,7 +55,7 @@ class BinaryType(object):
if operation_type == '<<': if operation_type == '<<':
return BinaryType.LEFT_SHIFT return BinaryType.LEFT_SHIFT
if operation_type == '>>': if operation_type == '>>':
return BinaryType.RIGHT_SHIT return BinaryType.RIGHT_SHIFT
if operation_type == '&': if operation_type == '&':
return BinaryType.AND return BinaryType.AND
if operation_type == '^': if operation_type == '^':
@ -98,7 +98,7 @@ class BinaryType(object):
return '-' return '-'
if operation_type == BinaryType.LEFT_SHIFT: if operation_type == BinaryType.LEFT_SHIFT:
return '<<' return '<<'
if operation_type == BinaryType.RIGHT_SHIT: if operation_type == BinaryType.RIGHT_SHIFT:
return '>>' return '>>'
if operation_type == BinaryType.AND: if operation_type == BinaryType.AND:
return '&' return '&'

@ -44,7 +44,7 @@ def convert_assignment(left, right, t, return_type):
elif t == AssignmentOperationType.ASSIGN_LEFT_SHIFT: elif t == AssignmentOperationType.ASSIGN_LEFT_SHIFT:
return Binary(left, left, right, BinaryType.LEFT_SHIFT) return Binary(left, left, right, BinaryType.LEFT_SHIFT)
elif t == AssignmentOperationType.ASSIGN_RIGHT_SHIFT: elif t == AssignmentOperationType.ASSIGN_RIGHT_SHIFT:
return Binary(left, left, right, BinaryType.RIGHT_SHIT) return Binary(left, left, right, BinaryType.RIGHT_SHIFT)
elif t == AssignmentOperationType.ASSIGN_ADDITION: elif t == AssignmentOperationType.ASSIGN_ADDITION:
return Binary(left, left, right, BinaryType.ADDITION) return Binary(left, left, right, BinaryType.ADDITION)
elif t == AssignmentOperationType.ASSIGN_SUBTRACTION: elif t == AssignmentOperationType.ASSIGN_SUBTRACTION:

Loading…
Cancel
Save