codegen-2 2.6.0__py3-none-any.whl → 2.7.0__py3-none-any.whl
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/models/expr.py +13 -0
- {codegen_2-2.6.0.dist-info → codegen_2-2.7.0.dist-info}/METADATA +1 -1
- {codegen_2-2.6.0.dist-info → codegen_2-2.7.0.dist-info}/RECORD +5 -5
- {codegen_2-2.6.0.dist-info → codegen_2-2.7.0.dist-info}/LICENSE +0 -0
- {codegen_2-2.6.0.dist-info → codegen_2-2.7.0.dist-info}/WHEEL +0 -0
codegen/models/expr.py
CHANGED
|
@@ -231,6 +231,19 @@ class ExprDivision(Expr):
|
|
|
231
231
|
return f"{self.left.to_python()} / {self.right.to_python()}"
|
|
232
232
|
|
|
233
233
|
|
|
234
|
+
@dataclass
|
|
235
|
+
class ExprTernary(Expr):
|
|
236
|
+
condition: Expr
|
|
237
|
+
true_expr: Expr
|
|
238
|
+
false_expr: Expr
|
|
239
|
+
|
|
240
|
+
def to_python(self):
|
|
241
|
+
return f"{self.true_expr.to_python()} if {self.condition.to_python()} else {self.false_expr.to_python()}"
|
|
242
|
+
|
|
243
|
+
def to_typescript(self):
|
|
244
|
+
return f"{self.true_expr.to_typescript()} ? {self.condition.to_typescript()} : {self.false_expr.to_typescript()}"
|
|
245
|
+
|
|
246
|
+
|
|
234
247
|
class PredefinedFn:
|
|
235
248
|
@dataclass
|
|
236
249
|
class is_null(Expr):
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
codegen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
codegen/models/__init__.py,sha256=j__FrDdGOILIo9jqEDElL3YP69h0xkL2SqrMxSqgpTc,457
|
|
3
3
|
codegen/models/ast.py,sha256=qq1xeWCMbTUXoOXszVYYPTaN-eiPJHdoTbsYbz5MKUo,10518
|
|
4
|
-
codegen/models/expr.py,sha256=
|
|
4
|
+
codegen/models/expr.py,sha256=pWZ3j6yH5DJ-gqEomznufUTP6uroqJebzffInsAqOos,10967
|
|
5
5
|
codegen/models/program.py,sha256=mrvtOp9WpaZ6B5KOGpFFLBXMtSCo-BpuGCEgipUuBV8,5062
|
|
6
6
|
codegen/models/statement.py,sha256=XWgjswJDZ3HpgE19d_HXyv6BGvr00qk4hQzLMDX3JHY,8558
|
|
7
7
|
codegen/models/types.py,sha256=Dl-wzGB1viA7EZj2CuTrZe1F133Q6ENVr_yRqxhde8M,178
|
|
8
8
|
codegen/models/var.py,sha256=sOzDrqJHkAgA2Tqhh6IelW3dDe2o7us6HPjaRBVKmCQ,2722
|
|
9
|
-
codegen_2-2.
|
|
10
|
-
codegen_2-2.
|
|
11
|
-
codegen_2-2.
|
|
12
|
-
codegen_2-2.
|
|
9
|
+
codegen_2-2.7.0.dist-info/LICENSE,sha256=Ea6itrykT9pvPGd0Kgl6FbrqdDwKswPZJmXMFVjUBqw,1064
|
|
10
|
+
codegen_2-2.7.0.dist-info/METADATA,sha256=H1tigBMx5WV9nJm9FzvpZWgrTXMI2m-Fiu_qkGtctio,487
|
|
11
|
+
codegen_2-2.7.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
12
|
+
codegen_2-2.7.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|