Make or_else and or_return operators (binary and suffix respectively)

This commit is contained in:
gingerBill
2021-08-15 17:14:35 +01:00
parent a3a20f09e2
commit 21cbac755e
16 changed files with 247 additions and 195 deletions

View File

@@ -2305,6 +2305,14 @@ lbValue lb_build_expr(lbProcedure *p, Ast *expr) {
}
case_end;
case_ast_node(oe, OrElseExpr, expr);
return lb_emit_or_else(p, oe->x, oe->y, tv);
case_end;
case_ast_node(oe, OrReturnExpr, expr);
return lb_emit_or_return(p, oe->expr, tv);
case_end;
case_ast_node(ta, TypeAssertion, expr);
TokenPos pos = ast_token(expr).pos;
Type *type = tv.type;