mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-26 23:44:58 -07:00
Unify AstTernaryExpr with AstTernaryIfExpr
Allow for both syntaxes `x if cond else y` and `cond ? x : y` Removes the confusing semantics behind `?:` which could be `if` or `when` depending on the context.
This commit is contained in:
@@ -343,7 +343,6 @@ AST_KIND(_ExprBegin, "", bool) \
|
||||
i32 builtin_id; \
|
||||
}) \
|
||||
AST_KIND(FieldValue, "field value", struct { Token eq; Ast *field, *value; }) \
|
||||
AST_KIND(TernaryExpr, "ternary expression", struct { Ast *cond, *x, *y; }) \
|
||||
AST_KIND(TernaryIfExpr, "ternary if expression", struct { Ast *x, *cond, *y; }) \
|
||||
AST_KIND(TernaryWhenExpr, "ternary when expression", struct { Ast *x, *cond, *y; }) \
|
||||
AST_KIND(TypeAssertion, "type assertion", struct { Ast *expr; Token dot; Ast *type; Type *type_hint; }) \
|
||||
|
||||
Reference in New Issue
Block a user