Replace context <- c {} with context = c;. context assignments are scope based

This commit is contained in:
gingerBill
2018-08-04 23:14:55 +01:00
parent 0718f14774
commit cdbf831a7a
10 changed files with 133 additions and 136 deletions
+4 -11
View File
@@ -167,10 +167,6 @@ bool check_is_terminating(Ast *node) {
}
return has_default;
case_end;
case_ast_node(pc, PushContext, node);
return check_is_terminating(pc->body);
case_end;
}
return false;
@@ -306,6 +302,10 @@ Type *check_assignment_variable(CheckerContext *ctx, Operand *lhs, Operand *rhs)
break;
}
case Addressing_Context: {
break;
}
default: {
if (lhs->expr->kind == Ast_SelectorExpr) {
// NOTE(bill): Extra error checks
@@ -1597,13 +1597,6 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) {
}
case_end;
case_ast_node(pa, PushContext, node);
Operand op = {};
check_expr(ctx, &op, pa->expr);
check_assignment(ctx, &op, t_context, str_lit("argument to context <-"));
check_stmt(ctx, pa->body, mod_flags);
case_end;
case_ast_node(fb, ForeignBlockDecl, node);
Ast *foreign_library = fb->foreign_library;
CheckerContext c = *ctx;