@(private) for foreign blocks; Improve foreign signature similarity rules

This commit is contained in:
gingerBill
2019-03-24 11:58:26 +00:00
parent 886054f0f8
commit b1684fe455
4 changed files with 55 additions and 28 deletions
+7 -1
View File
@@ -1993,6 +1993,12 @@ DECL_ATTRIBUTE_PROC(foreign_block_decl_attribute) {
error(elem, "Expected a string value for '%.*s'", LIT(name));
}
return true;
} else if (name == "private") {
if (ev.kind != ExactValue_Invalid) {
error(value, "'%.*s' does not expect a value", LIT(name));
}
c->foreign_context.is_private = true;
return true;
}
return false;
@@ -2414,7 +2420,7 @@ void check_collect_value_decl(CheckerContext *c, Ast *decl) {
ast_node(vd, ValueDecl, decl);
bool entity_is_private = false;
bool entity_is_private = c->foreign_context.is_private;
for_array(i, vd->attributes) {
Ast *attr = vd->attributes[i];
if (attr->kind != Ast_Attribute) continue;