codegen-2 2.8.0__tar.gz → 2.8.2__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.8.0 → codegen_2-2.8.2}/PKG-INFO +1 -1
- {codegen_2-2.8.0 → codegen_2-2.8.2}/codegen/models/expr.py +13 -0
- {codegen_2-2.8.0 → codegen_2-2.8.2}/pyproject.toml +1 -1
- {codegen_2-2.8.0 → codegen_2-2.8.2}/LICENSE +0 -0
- {codegen_2-2.8.0 → codegen_2-2.8.2}/README.md +0 -0
- {codegen_2-2.8.0 → codegen_2-2.8.2}/codegen/__init__.py +0 -0
- {codegen_2-2.8.0 → codegen_2-2.8.2}/codegen/models/__init__.py +0 -0
- {codegen_2-2.8.0 → codegen_2-2.8.2}/codegen/models/ast.py +0 -0
- {codegen_2-2.8.0 → codegen_2-2.8.2}/codegen/models/program.py +0 -0
- {codegen_2-2.8.0 → codegen_2-2.8.2}/codegen/models/statement.py +0 -0
- {codegen_2-2.8.0 → codegen_2-2.8.2}/codegen/models/types.py +0 -0
- {codegen_2-2.8.0 → codegen_2-2.8.2}/codegen/models/var.py +0 -0
|
@@ -128,6 +128,17 @@ class ExprRawPython(Expr):
|
|
|
128
128
|
return self.code
|
|
129
129
|
|
|
130
130
|
|
|
131
|
+
@dataclass
|
|
132
|
+
class ExprRawTypescript(Expr):
|
|
133
|
+
code: str
|
|
134
|
+
|
|
135
|
+
def to_python(self):
|
|
136
|
+
raise NotImplementedError("Raw Typescript cannot be converted to Python")
|
|
137
|
+
|
|
138
|
+
def to_typescript(self):
|
|
139
|
+
return self.code
|
|
140
|
+
|
|
141
|
+
|
|
131
142
|
@dataclass
|
|
132
143
|
class ExprVar(Expr): # a special identifier
|
|
133
144
|
var: Var
|
|
@@ -219,6 +230,8 @@ class ExprNegation(Expr):
|
|
|
219
230
|
expr: Expr
|
|
220
231
|
|
|
221
232
|
def to_python(self):
|
|
233
|
+
if isinstance(self.expr, ExprIs):
|
|
234
|
+
return f"{self.expr.left.to_python()} is not {self.expr.right.to_python()}"
|
|
222
235
|
return f"not {self.expr.to_wrapped_python()}"
|
|
223
236
|
|
|
224
237
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|