Enable basic support for evaluating float types
This commit is contained in:
@@ -11,6 +11,7 @@ class MinusEvaluator(Evaluator):
|
||||
try:
|
||||
return {
|
||||
Type.INTEGER: cls.evaluateForInteger,
|
||||
Type.FLOAT: cls.evaluateForFloat,
|
||||
Type.STRING: cls.evaluateForString,
|
||||
Type.LIST: cls.evaluateForList
|
||||
}[value.type](value.value)
|
||||
@@ -19,9 +20,12 @@ class MinusEvaluator(Evaluator):
|
||||
|
||||
@classmethod
|
||||
def evaluateForInteger(cls, value):
|
||||
|
||||
return Type.integer(-value)
|
||||
|
||||
@classmethod
|
||||
def evaluateForFloat(cls, value):
|
||||
return Type.float(-value)
|
||||
|
||||
@classmethod
|
||||
def evaluateForString(cls, value):
|
||||
return Type.string(value[::-1])
|
||||
|
||||
Reference in New Issue
Block a user