Disable constants inside structures
This commit is contained in:
@@ -659,12 +659,13 @@ parse_struct(Token *pos){
|
||||
token_match(OPEN_SCOPE);
|
||||
Ast_Scope *scope = begin_decl_scope(scratch, token_get());
|
||||
do{
|
||||
Token *token = token_get();
|
||||
|
||||
Ast_Decl *decl = parse_decl(false);
|
||||
if(!decl) compiler_error(token, "Failed to parse struct member");
|
||||
Token *token = token_expect(TK_Identifier);
|
||||
token_expect(TK_Colon);
|
||||
|
||||
Ast_Expr *typespec = parse_expr();
|
||||
Ast_Decl *decl = ast_var(token, typespec, token->intern_val, 0);
|
||||
decl->flags = set_flag(decl->flags, AST_AGGREGATE_CHILD);
|
||||
|
||||
scope->decls.add(decl);
|
||||
|
||||
}while(token_match(SAME_SCOPE));
|
||||
|
||||
Reference in New Issue
Block a user