From bc82943f0783f724f020cbcf0b15bd36b690a957 Mon Sep 17 00:00:00 2001 From: Alexis-Dubois Date: Thu, 1 May 2025 19:29:45 -0400 Subject: [PATCH 1/4] added LiteralInt, LiteralUInt and LiteralFloat --- libs/astx/src/astx/literals/__init__.py | 6 ++ libs/astx/src/astx/literals/numeric.py | 124 +++++++++++++++--------- 2 files changed, 82 insertions(+), 48 deletions(-) diff --git a/libs/astx/src/astx/literals/__init__.py b/libs/astx/src/astx/literals/__init__.py index 7e98ffa4..c8efd900 100644 --- a/libs/astx/src/astx/literals/__init__.py +++ b/libs/astx/src/astx/literals/__init__.py @@ -17,14 +17,17 @@ LiteralComplex, LiteralComplex32, LiteralComplex64, + LiteralFloat, LiteralFloat16, LiteralFloat32, LiteralFloat64, + LiteralInt, LiteralInt8, LiteralInt16, LiteralInt32, LiteralInt64, LiteralInt128, + LiteralUInt, LiteralUInt8, LiteralUInt16, LiteralUInt32, @@ -52,9 +55,11 @@ "LiteralDate", "LiteralDateTime", "LiteralDict", + "LiteralFloat", "LiteralFloat16", "LiteralFloat32", "LiteralFloat64", + "LiteralInt", "LiteralInt8", "LiteralInt16", "LiteralInt32", @@ -67,6 +72,7 @@ "LiteralTime", "LiteralTimestamp", "LiteralTuple", + "LiteralUInt", "LiteralUInt8", "LiteralUInt16", "LiteralUInt32", diff --git a/libs/astx/src/astx/literals/numeric.py b/libs/astx/src/astx/literals/numeric.py index 913c52f2..1ecc3919 100644 --- a/libs/astx/src/astx/literals/numeric.py +++ b/libs/astx/src/astx/literals/numeric.py @@ -18,39 +18,57 @@ Float16, Float32, Float64, + Floating, Int8, Int16, Int32, Int64, Int128, + SignedInteger, UInt8, UInt16, UInt32, UInt64, UInt128, + UnsignedInteger, ) @public @typechecked -class LiteralInt8(Literal): - """LiteralInt8 data type class.""" +class LiteralInt(Literal): + """LiteralInteger data type class.""" value: int def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: - """Initialize LiteralInt8.""" + """Initialize LiteralInteger.""" super().__init__(loc) self.value = value - self.type_ = Int8() + self.type_ = SignedInteger() self.loc = loc @public @typechecked -class LiteralInt16(Literal): +class LiteralInt8(LiteralInt): + """LiteralInt8 data type class.""" + + value: int + + def __init__( + self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION + ) -> None: + """Initialize LiteralInt8.""" + super().__init__(value, loc) + self.type_ = Int8() + + +@public +@typechecked +class LiteralInt16(LiteralInt): """LiteralInt16 data type class.""" value: int @@ -59,15 +77,13 @@ def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: """Initialize LiteralInt16.""" - super().__init__(loc) - self.value = value + super().__init__(value, loc) self.type_ = Int16() - self.loc = loc @public @typechecked -class LiteralInt32(Literal): +class LiteralInt32(LiteralInt): """LiteralInt32 data type class.""" value: int @@ -76,15 +92,13 @@ def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: """Initialize LiteralInt32.""" - super().__init__(loc) - self.value = value + super().__init__(value, loc) self.type_ = Int32() - self.loc = loc @public @typechecked -class LiteralInt64(Literal): +class LiteralInt64(LiteralInt): """LiteralInt64 data type class.""" value: int @@ -93,15 +107,13 @@ def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: """Initialize LiteralInt64.""" - super().__init__(loc) - self.value = value + super().__init__(value, loc) self.type_ = Int64() - self.loc = loc @public @typechecked -class LiteralInt128(Literal): +class LiteralInt128(LiteralInt): """LiteralInt128 data type class.""" value: int @@ -110,15 +122,30 @@ def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: """Initialize LiteralInt128.""" + super().__init__(value, loc) + self.type_ = Int128() + + +@public +@typechecked +class LiteralUInt(Literal): + """LiteralUInteger data type class.""" + + value: int + + def __init__( + self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION + ) -> None: + """Initialize LiteralUnsignedInteger.""" super().__init__(loc) self.value = value - self.type_ = Int128() + self.type_ = UnsignedInteger() self.loc = loc @public @typechecked -class LiteralUInt8(Literal): +class LiteralUInt8(LiteralUInt): """LiteralUInt8 data type class.""" value: int @@ -127,15 +154,13 @@ def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: """Initialize LiteralUInt8.""" - super().__init__(loc) - self.value = value + super().__init__(value, loc) self.type_ = UInt8() - self.loc = loc @public @typechecked -class LiteralUInt16(Literal): +class LiteralUInt16(LiteralUInt): """LiteralUInt16 data type class.""" value: int @@ -144,15 +169,13 @@ def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: """Initialize LiteralUInt16.""" - super().__init__(loc) - self.value = value + super().__init__(value, loc) self.type_ = UInt16() - self.loc = loc @public @typechecked -class LiteralUInt32(Literal): +class LiteralUInt32(LiteralUInt): """LiteralUInt32 data type class.""" value: int @@ -161,15 +184,13 @@ def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: """Initialize LiteralUInt32.""" - super().__init__(loc) - self.value = value + super().__init__(value, loc) self.type_ = UInt32() - self.loc = loc @public @typechecked -class LiteralUInt64(Literal): +class LiteralUInt64(LiteralUInt): """LiteralUInt64 data type class.""" value: int @@ -178,15 +199,13 @@ def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: """Initialize LiteralUInt64.""" - super().__init__(loc) - self.value = value + super().__init__(value, loc) self.type_ = UInt64() - self.loc = loc @public @typechecked -class LiteralUInt128(Literal): +class LiteralUInt128(LiteralUInt): """LiteralUInt128 data type class.""" value: int @@ -195,15 +214,13 @@ def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: """Initialize LiteralUInt128.""" - super().__init__(loc) - self.value = value + super().__init__(value, loc) self.type_ = UInt128() - self.loc = loc @public @typechecked -class LiteralFloat16(Literal): +class LiteralFloat(Literal): """LiteralFloat16 data type class.""" value: float @@ -214,13 +231,28 @@ def __init__( """Initialize LiteralFloat16.""" super().__init__(loc) self.value = value - self.type_ = Float16() + self.type_ = Floating() self.loc = loc @public @typechecked -class LiteralFloat32(Literal): +class LiteralFloat16(LiteralFloat): + """LiteralFloat16 data type class.""" + + value: float + + def __init__( + self, value: float, loc: SourceLocation = NO_SOURCE_LOCATION + ) -> None: + """Initialize LiteralFloat16.""" + super().__init__(value, loc) + self.type_ = Float16() + + +@public +@typechecked +class LiteralFloat32(LiteralFloat): """LiteralFloat32 data type class.""" value: float @@ -229,15 +261,13 @@ def __init__( self, value: float, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: """Initialize LiteralFloat32.""" - super().__init__(loc) - self.value = value + super().__init__(value, loc) self.type_ = Float32() - self.loc = loc @public @typechecked -class LiteralFloat64(Literal): +class LiteralFloat64(LiteralFloat): """LiteralFloat64 data type class.""" value: float @@ -246,10 +276,8 @@ def __init__( self, value: float, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: """Initialize LiteralFloat64.""" - super().__init__(loc) - self.value = value + super().__init__(value, loc) self.type_ = Float64() - self.loc = loc @public From fcbb11346d8db06a22e7e6449bbe7c2bd26824c1 Mon Sep 17 00:00:00 2001 From: Alexis-Dubois Date: Thu, 1 May 2025 19:41:16 -0400 Subject: [PATCH 2/4] update python_string transpiler to use heritage tree for numeric types --- .../src/astx_transpilers/python_string.py | 65 +++++-------------- libs/astx/src/astx/__init__.py | 6 ++ 2 files changed, 24 insertions(+), 47 deletions(-) diff --git a/libs/astx-transpilers/src/astx_transpilers/python_string.py b/libs/astx-transpilers/src/astx_transpilers/python_string.py index a939de0e..e7b9860c 100644 --- a/libs/astx-transpilers/src/astx_transpilers/python_string.py +++ b/libs/astx-transpilers/src/astx_transpilers/python_string.py @@ -413,13 +413,6 @@ def visit(self, node: astx.LiteralBoolean) -> str: """Handle LiteralBoolean nodes.""" return "True" if node.value else "False" - @dispatch # type: ignore[no-redef] - def visit(self, node: astx.LiteralComplex32) -> str: - """Handle LiteralComplex32 nodes.""" - real = node.value[0] - imag = node.value[1] - return f"complex({real}, {imag})" - @dispatch # type: ignore[no-redef] def visit(self, node: astx.LiteralComplex) -> str: """Handle LiteralComplex nodes.""" @@ -428,30 +421,13 @@ def visit(self, node: astx.LiteralComplex) -> str: return f"complex({real}, {imag})" @dispatch # type: ignore[no-redef] - def visit(self, node: astx.LiteralComplex64) -> str: - """Handle LiteralComplex64 nodes.""" - real = node.value[0] - imag = node.value[1] - return f"complex({real}, {imag})" - - @dispatch # type: ignore[no-redef] - def visit(self, node: astx.LiteralFloat16) -> str: - """Handle LiteralFloat nodes.""" - return str(node.value) - - @dispatch # type: ignore[no-redef] - def visit(self, node: astx.LiteralFloat32) -> str: - """Handle LiteralFloat nodes.""" - return str(node.value) - - @dispatch # type: ignore[no-redef] - def visit(self, node: astx.LiteralFloat64) -> str: + def visit(self, node: astx.LiteralFloat) -> str: """Handle LiteralFloat nodes.""" return str(node.value) @dispatch # type: ignore[no-redef] - def visit(self, node: astx.LiteralInt32) -> str: - """Handle LiteralInt32 nodes.""" + def visit(self, node: astx.LiteralInt) -> str: + """Handle LiteralInt nodes.""" return str(node.value) @dispatch # type: ignore[no-redef] @@ -459,6 +435,11 @@ def visit(self, node: astx.LiteralString) -> str: """Handle LiteralUTF8String nodes.""" return repr(node.value) + @dispatch # type: ignore[no-redef] + def visit(self, node: astx.LiteralUInt) -> str: + """Handle LiteralUInt nodes.""" + return str(node.value) + @dispatch # type: ignore[no-redef] def visit(self, node: astx.LiteralUTF8String) -> str: """Handle LiteralUTF8String nodes.""" @@ -529,33 +510,18 @@ def visit(self, node: astx.SwitchStmt) -> str: return f"match {self.visit(node.value)}:\n{cases_visited}" @dispatch # type: ignore[no-redef] - def visit(self, node: astx.Complex32) -> str: - """Handle Complex32 nodes.""" + def visit(self, node: astx.Complex) -> str: + """Handle Complex nodes.""" return "Complex" @dispatch # type: ignore[no-redef] - def visit(self, node: astx.Complex64) -> str: - """Handle Complex64 nodes.""" - return "Complex" - - @dispatch # type: ignore[no-redef] - def visit(self, node: astx.Float16) -> str: + def visit(self, node: astx.Floating) -> str: """Handle Float nodes.""" return "float" @dispatch # type: ignore[no-redef] - def visit(self, node: astx.Float32) -> str: - """Handle Float nodes.""" - return "float" - - @dispatch # type: ignore[no-redef] - def visit(self, node: astx.Float64) -> str: - """Handle Float nodes.""" - return "float" - - @dispatch # type: ignore[no-redef] - def visit(self, node: astx.Int32) -> str: - """Handle Int32 nodes.""" + def visit(self, node: astx.SignedInteger) -> str: + """Handle SignedInteger nodes.""" return "int" @dispatch # type: ignore[no-redef] @@ -577,6 +543,11 @@ def visit(self, node: astx.UnaryOp) -> str: operand = self.visit(node.operand) return f"({node.op_code}{operand})" + @dispatch # type: ignore[no-redef] + def visit(self, node: astx.UnsignedInteger) -> str: + """Handle UnsignedInteger nodes.""" + return "int" + @dispatch # type: ignore[no-redef] def visit(self, node: astx.UTF8Char) -> str: """Handle UTF8Char nodes.""" diff --git a/libs/astx/src/astx/__init__.py b/libs/astx/src/astx/__init__.py index 59e13e4c..9514bb91 100644 --- a/libs/astx/src/astx/__init__.py +++ b/libs/astx/src/astx/__init__.py @@ -94,9 +94,11 @@ LiteralDate, LiteralDateTime, LiteralDict, + LiteralFloat, LiteralFloat16, LiteralFloat32, LiteralFloat64, + LiteralInt, LiteralInt8, LiteralInt16, LiteralInt32, @@ -109,6 +111,7 @@ LiteralTime, LiteralTimestamp, LiteralTuple, + LiteralUInt, LiteralUInt8, LiteralUInt16, LiteralUInt32, @@ -296,9 +299,11 @@ def get_version() -> str: "LiteralDate", "LiteralDateTime", "LiteralDict", + "LiteralFloat", "LiteralFloat16", "LiteralFloat32", "LiteralFloat64", + "LiteralInt", "LiteralInt8", "LiteralInt16", "LiteralInt32", @@ -311,6 +316,7 @@ def get_version() -> str: "LiteralTime", "LiteralTimestamp", "LiteralTuple", + "LiteralUInt", "LiteralUInt8", "LiteralUInt16", "LiteralUInt32", From e021cf2954b49d109632cef8269d2c2f57b812ec Mon Sep 17 00:00:00 2001 From: Alexis-Dubois Date: Thu, 1 May 2025 20:21:18 -0400 Subject: [PATCH 3/4] added tests --- libs/astx-transpilers/tests/test_python.py | 182 +++++++++++++++++++++ libs/astx/tests/datatypes/test_float.py | 1 + libs/astx/tests/datatypes/test_integer.py | 2 + 3 files changed, 185 insertions(+) diff --git a/libs/astx-transpilers/tests/test_python.py b/libs/astx-transpilers/tests/test_python.py index aaba1901..56047b91 100644 --- a/libs/astx-transpilers/tests/test_python.py +++ b/libs/astx-transpilers/tests/test_python.py @@ -262,6 +262,48 @@ def test_transpiler_functiondef() -> None: assert generated_code == expected_code, "generated_code != expected_code" +def test_literal_int() -> None: + """Test astx.LiteralInt.""" + # Create a LiteralInt node + literal_int_node = astx.LiteralInt(value=42) + + # Generate Python code + generated_code = translate(literal_int_node) + expected_code = "42" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + +def test_literal_int8() -> None: + """Test astx.LiteralInt8.""" + # Create a LiteralInt8 node + literal_int8_node = astx.LiteralInt8(value=42) + + # Generate Python code + generated_code = translate(literal_int8_node) + expected_code = "42" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + +def test_literal_int16() -> None: + """Test astx.LiteralInt16.""" + # Create a LiteralInt16 node + literal_int16_node = astx.LiteralInt16(value=42) + + # Generate Python code + generated_code = translate(literal_int16_node) + expected_code = "42" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + def test_literal_int32() -> None: """Test astx.LiteralInt32.""" # Create a LiteralInt32 node @@ -274,6 +316,132 @@ def test_literal_int32() -> None: assert generated_code == expected_code, "generated_code != expected_code" +def test_literal_int64() -> None: + """Test astx.LiteralInt64.""" + # Create a LiteralInt64 node + literal_int64_node = astx.LiteralInt64(value=42) + + # Generate Python code + generated_code = translate(literal_int64_node) + expected_code = "42" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + +def test_literal_int128() -> None: + """Test astx.LiteralInt128.""" + # Create a LiteralInt128 node + literal_int128_node = astx.LiteralInt128(value=42) + + # Generate Python code + generated_code = translate(literal_int128_node) + expected_code = "42" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + +def test_literal_Uint() -> None: + """Test astx.LiteralUInt.""" + # Create a LiteralUInt node + literal_Uint_node = astx.LiteralUInt(value=42) + + # Generate Python code + generated_code = translate(literal_Uint_node) + expected_code = "42" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + +def test_literal_Uint8() -> None: + """Test astx.LiteralUInt8.""" + # Create a LiteralUInt8 node + literal_Uint8_node = astx.LiteralUInt8(value=42) + + # Generate Python code + generated_code = translate(literal_Uint8_node) + expected_code = "42" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + +def test_literal_Uint16() -> None: + """Test astx.LiteralUInt16.""" + # Create a LiteralUInt16 node + literal_Uint16_node = astx.LiteralUInt16(value=42) + + # Generate Python code + generated_code = translate(literal_Uint16_node) + expected_code = "42" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + +def test_literal_Uint32() -> None: + """Test astx.LiteralUInt32.""" + # Create a LiteralUInt32 node + literal_Uint32_node = astx.LiteralUInt32(value=42) + + # Generate Python code + generated_code = translate(literal_Uint32_node) + expected_code = "42" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + +def test_literal_Uint64() -> None: + """Test astx.LiteralUInt64.""" + # Create a LiteralInt64 node + literal_Uint64_node = astx.LiteralUInt64(value=42) + + # Generate Python code + generated_code = translate(literal_Uint64_node) + expected_code = "42" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + +def test_literal_Uint128() -> None: + """Test astx.LiteralUInt128.""" + # Create a LiteralUInt128 node + literal_Uint128_node = astx.LiteralUInt128(value=42) + + # Generate Python code + generated_code = translate(literal_Uint128_node) + expected_code = "42" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + +def test_literal_float() -> None: + """Test astx.LiteralFloat.""" + # Create a LiteralFloat node + literal_float_node = astx.LiteralFloat(value=3.14) + + # Generate Python code + generated_code = translate(literal_float_node) + expected_code = "3.14" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + def test_literal_float16() -> None: """Test astx.LiteralFloat16.""" # Create a LiteralFloat16 node @@ -310,6 +478,20 @@ def test_literal_float64() -> None: assert generated_code == expected_code, "generated_code != expected_code" +def test_literal_complex() -> None: + """Test astx.LiteralComplex.""" + # Create a LiteralComplex node + literal_complex_node = astx.LiteralComplex(real=1, imag=2.8) + + # Generate Python code + generated_code = translate(literal_complex_node) + expected_code = "complex(1, 2.8)" + + assert generated_code == expected_code, ( + f"Expected '{expected_code}', but got '{generated_code}'" + ) + + def test_literal_complex32() -> None: """Test astx.LiteralComplex32.""" # Create a LiteralComplex32 node diff --git a/libs/astx/tests/datatypes/test_float.py b/libs/astx/tests/datatypes/test_float.py index e97eef1c..52c59b0e 100644 --- a/libs/astx/tests/datatypes/test_float.py +++ b/libs/astx/tests/datatypes/test_float.py @@ -13,6 +13,7 @@ VAR_A = Variable("a") FLOAT_LITERAL_CLASSES = [ + astx.LiteralFloat, astx.LiteralFloat64, astx.LiteralFloat32, astx.LiteralFloat16, diff --git a/libs/astx/tests/datatypes/test_integer.py b/libs/astx/tests/datatypes/test_integer.py index ae14f5ba..23240ed6 100644 --- a/libs/astx/tests/datatypes/test_integer.py +++ b/libs/astx/tests/datatypes/test_integer.py @@ -13,11 +13,13 @@ VAR_A = Variable("a") LITERAL_CLASSES = [ + astx.LiteralInt, astx.LiteralInt8, astx.LiteralInt16, astx.LiteralInt32, astx.LiteralInt64, astx.LiteralInt128, + astx.LiteralUInt, astx.LiteralUInt8, astx.LiteralUInt16, astx.LiteralUInt32, From e7ffcee5eac4e6ecf8602c38df14f7018806643a Mon Sep 17 00:00:00 2001 From: Alexis-Dubois Date: Thu, 1 May 2025 20:55:13 -0400 Subject: [PATCH 4/4] Fix: Added missing numeric literal classes, python string can now support all numerical types --- libs/astx/src/astx/literals/numeric.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/libs/astx/src/astx/literals/numeric.py b/libs/astx/src/astx/literals/numeric.py index 1ecc3919..b079c0dd 100644 --- a/libs/astx/src/astx/literals/numeric.py +++ b/libs/astx/src/astx/literals/numeric.py @@ -56,8 +56,6 @@ def __init__( class LiteralInt8(LiteralInt): """LiteralInt8 data type class.""" - value: int - def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -71,8 +69,6 @@ def __init__( class LiteralInt16(LiteralInt): """LiteralInt16 data type class.""" - value: int - def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -86,8 +82,6 @@ def __init__( class LiteralInt32(LiteralInt): """LiteralInt32 data type class.""" - value: int - def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -101,8 +95,6 @@ def __init__( class LiteralInt64(LiteralInt): """LiteralInt64 data type class.""" - value: int - def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -116,8 +108,6 @@ def __init__( class LiteralInt128(LiteralInt): """LiteralInt128 data type class.""" - value: int - def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -148,8 +138,6 @@ def __init__( class LiteralUInt8(LiteralUInt): """LiteralUInt8 data type class.""" - value: int - def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -163,8 +151,6 @@ def __init__( class LiteralUInt16(LiteralUInt): """LiteralUInt16 data type class.""" - value: int - def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -178,8 +164,6 @@ def __init__( class LiteralUInt32(LiteralUInt): """LiteralUInt32 data type class.""" - value: int - def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -193,8 +177,6 @@ def __init__( class LiteralUInt64(LiteralUInt): """LiteralUInt64 data type class.""" - value: int - def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -208,8 +190,6 @@ def __init__( class LiteralUInt128(LiteralUInt): """LiteralUInt128 data type class.""" - value: int - def __init__( self, value: int, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -240,8 +220,6 @@ def __init__( class LiteralFloat16(LiteralFloat): """LiteralFloat16 data type class.""" - value: float - def __init__( self, value: float, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -255,8 +233,6 @@ def __init__( class LiteralFloat32(LiteralFloat): """LiteralFloat32 data type class.""" - value: float - def __init__( self, value: float, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: @@ -270,8 +246,6 @@ def __init__( class LiteralFloat64(LiteralFloat): """LiteralFloat64 data type class.""" - value: float - def __init__( self, value: float, loc: SourceLocation = NO_SOURCE_LOCATION ) -> None: