Make static an attribute rather than a keyword prefix

This commit is contained in:
gingerBill
2019-02-23 22:17:27 +00:00
parent e551d2b25e
commit a9ab90bd24
9 changed files with 63 additions and 48 deletions
+7 -2
View File
@@ -718,9 +718,14 @@ void check_var_decl(CheckerContext *ctx, Entity *e, Ast *type_expr, Ast *init_ex
check_decl_attributes(ctx, decl->attributes, var_decl_attribute, &ac);
}
e->Variable.is_export = ac.is_export;
ac.link_name = handle_link_name(ctx, e->token, ac.link_name, ac.link_prefix);
e->Variable.thread_local_model = ac.thread_local_model;
e->Variable.is_export = ac.is_export;
if (ac.is_static) {
e->flags |= EntityFlag_Static;
} else {
e->flags &= ~EntityFlag_Static;
}
ac.link_name = handle_link_name(ctx, e->token, ac.link_name, ac.link_prefix);
String context_name = str_lit("variable declaration");