codegen-2 2.11.0__tar.gz → 2.11.1__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.11.0 → codegen_2-2.11.1}/PKG-INFO +1 -1
- {codegen_2-2.11.0 → codegen_2-2.11.1}/codegen/models/expr.py +2 -2
- {codegen_2-2.11.0 → codegen_2-2.11.1}/codegen/models/statement.py +5 -1
- {codegen_2-2.11.0 → codegen_2-2.11.1}/pyproject.toml +1 -1
- {codegen_2-2.11.0 → codegen_2-2.11.1}/LICENSE +0 -0
- {codegen_2-2.11.0 → codegen_2-2.11.1}/README.md +0 -0
- {codegen_2-2.11.0 → codegen_2-2.11.1}/codegen/__init__.py +0 -0
- {codegen_2-2.11.0 → codegen_2-2.11.1}/codegen/models/__init__.py +0 -0
- {codegen_2-2.11.0 → codegen_2-2.11.1}/codegen/models/ast.py +0 -0
- {codegen_2-2.11.0 → codegen_2-2.11.1}/codegen/models/program.py +0 -0
- {codegen_2-2.11.0 → codegen_2-2.11.1}/codegen/models/types.py +0 -0
- {codegen_2-2.11.0 → codegen_2-2.11.1}/codegen/models/var.py +0 -0
|
@@ -164,10 +164,10 @@ class ExprAwait(Expr):
|
|
|
164
164
|
expr: Expr
|
|
165
165
|
|
|
166
166
|
def to_python(self):
|
|
167
|
-
return f"await {self.expr.to_python()}"
|
|
167
|
+
return f"(await {self.expr.to_python()})"
|
|
168
168
|
|
|
169
169
|
def to_typescript(self):
|
|
170
|
-
return f"await {self.expr.to_typescript()}"
|
|
170
|
+
return f"(await {self.expr.to_typescript()})"
|
|
171
171
|
|
|
172
172
|
|
|
173
173
|
@dataclass
|
|
@@ -239,7 +239,11 @@ class SingleExprStatement(Statement):
|
|
|
239
239
|
expr: Expr
|
|
240
240
|
|
|
241
241
|
def to_python(self):
|
|
242
|
-
|
|
242
|
+
stmt = self.expr.to_python()
|
|
243
|
+
if stmt[0] == "(" and stmt[-1] == ")":
|
|
244
|
+
# remove parentheses if they are not needed
|
|
245
|
+
stmt = stmt[1:-1]
|
|
246
|
+
return stmt
|
|
243
247
|
|
|
244
248
|
def to_typescript(self):
|
|
245
249
|
return self.expr.to_typescript()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|