From b1684fe455985b1dd7caf0b1be7ff91447dabd59 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 24 Mar 2019 11:58:26 +0000 Subject: `@(private)` for `foreign` blocks; Improve foreign signature similarity rules --- src/checker.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/checker.cpp') diff --git a/src/checker.cpp b/src/checker.cpp index 130c4aee5..971c714b2 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -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; -- cgit v1.2.3