commit 298c24d8410b08bc089980d6f8c4c3f9942f1619
parent 436c4b0fc35ff425c4fe6d6130033995df75c67a
Author: Drew DeVault <sir@cmpwn.com>
Date: Sun, 13 Dec 2020 09:33:27 -0500
parse: fix some oversights with type flags
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/parse.c b/src/parse.c
@@ -233,7 +233,7 @@ parse_type(struct parser *par, struct ast_type *type)
struct token tok = {0};
switch (lex(par->lex, &tok)) {
case T_CONST:
- type->flags |= TYPE_CONST;
+ type->flags |= TYPE_FLAGS_CONST;
break;
default:
unlex(par->lex, &tok);
@@ -300,7 +300,7 @@ parse_type(struct parser *par, struct ast_type *type)
case T_ENUM:
assert(0); // TODO: Enums
case T_NULLABLE:
- type->pointer.flags |= POINTER_NULLABLE;
+ type->pointer.flags |= POINTER_FLAGS_NULLABLE;
want(par, T_TIMES, NULL);
trace(TR_PARSE, "nullable");
/* fallthrough */
@@ -330,7 +330,7 @@ parse_type(struct parser *par, struct ast_type *type)
parse_identifier(par, &type->alias);
break;
}
- trleave(TR_PARSE, "%s%s", (type->flags & TYPE_CONST) ? "const " : "",
+ trleave(TR_PARSE, "%s%s", (type->flags & TYPE_FLAGS_CONST) ? "const " : "",
type_storage_unparse(type->storage));
}
@@ -425,7 +425,7 @@ parse_global_decl(struct parser *par, enum lexical_token mode,
want(par, T_COLON, NULL);
parse_type(par, &i->type);
if (mode == T_CONST) {
- i->type.flags |= TYPE_CONST;
+ i->type.flags |= TYPE_FLAGS_CONST;
}
want(par, T_EQUAL, NULL);
parse_simple_expression(par, &i->init);