Skip to content
Snippets Groups Projects
Commit 82a249d5 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Parse C single prec float literals out of OCCA defs

parent 0f5e659a
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,15 @@ def to_python_literal(value):
# It's a float
return repr(float(value))
if value.endswith("f"):
try:
float(value[:-1])
except ValueError:
pass
else:
# It's a float
return repr(float(value[:-1]))
return repr(value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment