diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-15 14:42:08 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-15 14:42:08 +0100 |
| commit | c5ef5279d4346fe1b38815060303b17159adbc82 (patch) | |
| tree | 37279f3cf00ba490ec0a42af7b5b347cc4925af7 /src/checker.cpp | |
| parent | d3c24d159fbb380393ff6ce9261be734646cb5c4 (diff) | |
Add foreign variables
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 53d9c77aa..3dabbb694 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1555,6 +1555,14 @@ void check_collect_entities(Checker *c, Array<AstNode *> nodes, bool is_file_sco gd->flags &= ~VarDeclFlag_using; // NOTE(bill): This error will be only caught once error_node(name, "`using` is not allowed at the file scope"); } + + AstNode *fl = c->context.curr_foreign_library; + if (fl != NULL) { + GB_ASSERT(fl->kind == AstNode_Ident); + e->Variable.is_foreign = true; + e->Variable.foreign_library_ident = fl; + } + entities[entity_count++] = e; DeclInfo *d = di; |