diff options
| author | gingerBill <bill@gingerbill.org> | 2019-02-23 21:39:47 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-02-23 21:39:47 +0000 |
| commit | e551d2b25ea39afb95f7b8ee4309ef0cc8b502b8 (patch) | |
| tree | 664e1906ba18e2d7d1fdb64915c54c1d10b4536d /src/check_decl.cpp | |
| parent | 38ae2e9efaf8d227a138d749085599e7ee9fde54 (diff) | |
Replace `foreign export {}` with `@export`
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 91fd0ff01..e9d6d5860 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -551,20 +551,20 @@ void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) { check_procedure_type(&tmp_ctx, proc_type, pl->type); TypeProc *pt = &proc_type->Proc; - - bool is_foreign = e->Procedure.is_foreign; - bool is_export = e->Procedure.is_export; - bool is_require_results = (pl->tags & ProcTag_require_results) != 0; - AttributeContext ac = make_attribute_context(e->Procedure.link_prefix); if (d != nullptr) { check_decl_attributes(ctx, d->attributes, proc_decl_attribute, &ac); } + e->Procedure.is_export = ac.is_export; e->deprecated_message = ac.deprecated_message; ac.link_name = handle_link_name(ctx, e->token, ac.link_name, ac.link_prefix); + bool is_foreign = e->Procedure.is_foreign; + bool is_export = e->Procedure.is_export; + bool is_require_results = (pl->tags & ProcTag_require_results) != 0; + if (e->pkg != nullptr && e->token.string == "main") { if (pt->param_count != 0 || pt->result_count != 0) { @@ -718,6 +718,7 @@ 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; |