Implement Explicit context creation #639

This commit is contained in:
gingerBill
2020-05-14 00:13:26 +01:00
parent af1d4d6e72
commit f661d34049
6 changed files with 39 additions and 11 deletions

View File

@@ -7724,6 +7724,15 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
return kind;
}
if (unparen_expr(c->assignment_lhs_hint) == node) {
c->scope->flags |= ScopeFlag_ContextDefined;
}
if ((c->scope->flags & ScopeFlag_ContextDefined) == 0) {
error(node, "'context' has not been defined within this scope");
// Continue with value
}
init_core_context(c->checker);
o->mode = Addressing_Context;
o->type = t_context;