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
+1 -6
View File
@@ -11,6 +11,7 @@ enum AddressingMode {
Addressing_NoValue, // no value (void in C)
Addressing_Value, // computed value (rvalue)
Addressing_Immutable, // immutable computed value (const rvalue)
Addressing_Context, // context value
Addressing_Variable, // addressable variable (lvalue)
Addressing_Constant, // constant
Addressing_Type, // type
@@ -191,7 +192,6 @@ enum StmtAllowFlag {
StmtAllowFlag_None = 0,
StmtAllowFlag_In = 1<<0,
StmtAllowFlag_Label = 1<<1,
StmtAllowFlag_Context = 1<<2,
};
#define AST_KINDS \
@@ -343,11 +343,6 @@ AST_KIND(_ComplexStmtBegin, "", bool) \
Token token; \
Array<Ast *> list; \
}) \
AST_KIND(PushContext, "context <- statement", struct { \
Token token; \
Ast *expr; \
Ast *body; \
}) \
AST_KIND(_ComplexStmtEnd, "", bool) \
AST_KIND(_StmtEnd, "", bool) \
AST_KIND(_DeclBegin, "", bool) \