diff --git a/tests/serializer/python.py b/tests/serializer/python.py index 8dc43f4..786b15b 100644 --- a/tests/serializer/python.py +++ b/tests/serializer/python.py @@ -22,6 +22,7 @@ from midas.ast.python import ( ReturnStmt, SetExpr, Stmt, + TernaryExpr, TypeAssign, UnaryExpr, VariableExpr, @@ -245,3 +246,11 @@ class PythonAstJsonSerializer( "type": expr.type.accept(self), "expr": expr.expr.accept(self), } + + def visit_ternary_expr(self, expr: TernaryExpr) -> dict: + return { + "_type": "TernaryExpr", + "test": expr.test.accept(self), + "if_true": expr.if_true.accept(self), + "if_false": expr.if_false.accept(self), + }