mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-28 07:08:24 -04:00
Add @force to foreign import
This commit is contained in:
1 parent
44a303e577
commit
3b898e5224
7 files changed
+44
-1
No files matched your search
+5
-1
@@ -1049,6 +1049,8 @@ Ast *ast_foreign_import_decl(AstFile *f, Token token, Array<Token> filepaths, To
|
||||
result->ForeignImportDecl.library_name = library_name;
|
||||
result->ForeignImportDecl.docs = docs;
|
||||
result->ForeignImportDecl.comment = comment;
|
||||
result->ForeignImportDecl.attributes.allocator = heap_allocator();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -3865,7 +3867,9 @@ Ast *parse_attribute(AstFile *f, Token token, TokenKind open_kind, TokenKind clo
|
||||
array_add(&decl->ValueDecl.attributes, attribute);
|
||||
} else if (decl->kind == Ast_ForeignBlockDecl) {
|
||||
array_add(&decl->ForeignBlockDecl.attributes, attribute);
|
||||
} else {
|
||||
} else if (decl->kind == Ast_ForeignImportDecl) {
|
||||
array_add(&decl->ForeignImportDecl.attributes, attribute);
|
||||
}else {
|
||||
syntax_error(decl, "Expected a value or foreign declaration after an attribute, got %.*s", LIT(ast_strings[decl->kind]));
|
||||
return ast_bad_stmt(f, token, f->curr_token);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user