Add @force to foreign import

This commit is contained in:
gingerBill
2019-11-01 19:26:22 +00:00
parent 44a303e577
commit 3b898e5224
7 changed files with 44 additions and 1 deletions
+1
View File
@@ -410,6 +410,7 @@ Foreign_Import_Decl :: struct {
name: ^Ident,
collection_name: string,
fullpaths: []string,
attributes: [dynamic]^Attribute, // dynamic as parsing will add to them lazily
comment: ^Comment_Group,
}
+3
View File
@@ -827,6 +827,9 @@ parse_attribute :: proc(p: ^Parser, tok: tokenizer.Token, open_kind, close_kind:
case ast.Foreign_Block_Decl:
if d.docs == nil do d.docs = docs;
append(&d.attributes, attribute);
case ast.Foreign_Import_Decl:
if d.docs == nil do d.docs = docs;
append(&d.attributes, attribute);
case:
error(p, decl.pos, "expected a value or foreign declaration after an attribute");
free(attribute);