Browse Source

Add clone for `ast.Ternary_If_Expr` and `ast.Ternary_When_Expr`

gingerBill 5 years ago
parent
commit
4cf70f360b
1 changed files with 10 additions and 0 deletions
  1. 10 0
      core/odin/ast/clone.odin

+ 10 - 0
core/odin/ast/clone.odin

@@ -136,6 +136,16 @@ clone_node :: proc(node: ^Node) -> ^Node {
 		r.cond = clone(r.cond);
 		r.x    = clone(r.x);
 		r.y    = clone(r.y);
+	case Ternary_If_Expr:
+		r := cast(^Ternary_If_Expr)res;
+		r.x    = clone(r.x);
+		r.cond = clone(r.cond);
+		r.y    = clone(r.y);
+	case Ternary_When_Expr:
+		r := cast(^Ternary_When_Expr)res;
+		r.x    = clone(r.x);
+		r.cond = clone(r.cond);
+		r.y    = clone(r.y);
 	case Type_Assertion:
 		r := cast(^Type_Assertion)res;
 		r.expr = clone(r.expr);