Skip to content
Snippets Groups Projects
Commit d6b9894c authored by Daniel Bauer's avatar Daniel Bauer :speech_balloon:
Browse files

print integer literals >32 bit with 'l' suffix

parent d0654625
No related branches found
No related tags found
1 merge request!387Cast integer literals to target type
...@@ -484,7 +484,8 @@ class PsIntegerType(PsScalarType, ABC): ...@@ -484,7 +484,8 @@ class PsIntegerType(PsScalarType, ABC):
raise PsTypeError(f"Given value {value} is not of required type {np_dtype}") raise PsTypeError(f"Given value {value} is not of required type {np_dtype}")
unsigned_suffix = "" if self.signed else "u" unsigned_suffix = "" if self.signed else "u"
# TODO: cast literal to correct type? # TODO: cast literal to correct type?
return str(value) + unsigned_suffix long_suffix = "" if self._width <= 32 else "l"
return str(value) + unsigned_suffix + long_suffix
def create_constant(self, value: Any) -> Any: def create_constant(self, value: Any) -> Any:
np_type = self.NUMPY_TYPES[self._width] np_type = self.NUMPY_TYPES[self._width]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment