From 1c5c418f1c6689083afa1357faf1ba95def31d06 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Tue, 2 Jun 2026 13:05:06 +0200 Subject: [PATCH] fix(tests): serialize ternary expressions --- tests/serializer/python.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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), + }