Commit e8af2842 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix Neg expressions - they can also be floats

parent 076c8af4
......@@ -1748,11 +1748,17 @@ def neg_expression(root, context):
if is_number(basic):
# If the parameter is a raw number, no need for an Neg expression
if is_real(basic):
kind = 'RealType'
sort = 'PrReal'
else:
kind = 'IntegerType'
sort = 'Universal_Integer'
expr.expr.value[0] = u'-{}'.format(expr.expr.value[0])
attrs = {'Min' : str(-float(basic.Max)),
'Max' : str(-float(basic.Min)),
'kind': 'IntegerType'}
expr.expr.exprType = type('Universal_Integer', (object,), attrs)
'kind': kind}
expr.expr.exprType = type(sort, (object,), attrs)
return expr.expr, errors, warnings
try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment