codegen-2 2.15.2__tar.gz → 2.15.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codegen_2-2.15.2 → codegen_2-2.15.4}/PKG-INFO +1 -1
- {codegen_2-2.15.2 → codegen_2-2.15.4}/codegen/models/expr.py +4 -0
- {codegen_2-2.15.2 → codegen_2-2.15.4}/codegen/models/statement.py +6 -0
- {codegen_2-2.15.2 → codegen_2-2.15.4}/pyproject.toml +1 -1
- {codegen_2-2.15.2 → codegen_2-2.15.4}/LICENSE +0 -0
- {codegen_2-2.15.2 → codegen_2-2.15.4}/README.md +0 -0
- {codegen_2-2.15.2 → codegen_2-2.15.4}/codegen/__init__.py +0 -0
- {codegen_2-2.15.2 → codegen_2-2.15.4}/codegen/models/__init__.py +0 -0
- {codegen_2-2.15.2 → codegen_2-2.15.4}/codegen/models/ast.py +0 -0
- {codegen_2-2.15.2 → codegen_2-2.15.4}/codegen/models/program.py +0 -0
- {codegen_2-2.15.2 → codegen_2-2.15.4}/codegen/models/types.py +0 -0
- {codegen_2-2.15.2 → codegen_2-2.15.4}/codegen/models/var.py +0 -0
|
@@ -71,6 +71,10 @@ class ExprConstant(Expr):
|
|
|
71
71
|
+ ", ".join(sorted((ExprConstant.constant_to_python(v) for v in val)))
|
|
72
72
|
+ "}"
|
|
73
73
|
)
|
|
74
|
+
if isinstance(val, tuple):
|
|
75
|
+
return (
|
|
76
|
+
"(" + ", ".join([ExprConstant.constant_to_python(v) for v in val]) + ")"
|
|
77
|
+
)
|
|
74
78
|
raise NotImplementedError()
|
|
75
79
|
|
|
76
80
|
@staticmethod
|
|
@@ -342,6 +342,9 @@ class IfStatement(Statement):
|
|
|
342
342
|
def to_python(self):
|
|
343
343
|
return f"if {self.cond.to_python()}:"
|
|
344
344
|
|
|
345
|
+
def to_typescript(self):
|
|
346
|
+
return f"if ({self.cond.to_typescript()})"
|
|
347
|
+
|
|
345
348
|
|
|
346
349
|
@dataclass
|
|
347
350
|
class TryStatement(Statement):
|
|
@@ -364,6 +367,9 @@ class ElseStatement(Statement):
|
|
|
364
367
|
def to_python(self):
|
|
365
368
|
return "else:"
|
|
366
369
|
|
|
370
|
+
def to_typescript(self):
|
|
371
|
+
return "else"
|
|
372
|
+
|
|
367
373
|
|
|
368
374
|
@dataclass
|
|
369
375
|
class Comment(Statement):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|