do keyword for inline statements instead of blocks

This commit is contained in:
Ginger Bill
2017-07-01 11:38:44 +01:00
parent 33f4af2e19
commit ed089b44b9
11 changed files with 198 additions and 164 deletions
+8 -1
View File
@@ -262,6 +262,7 @@ struct CheckerContext {
u32 stmt_state_flags;
bool in_defer; // TODO(bill): Actually handle correctly
bool allow_polymorphic_types;
bool no_polymorphic_errors;
String proc_name;
Type * type_hint;
DeclInfo * curr_proc_decl;
@@ -1474,8 +1475,10 @@ void check_procedure_overloading(Checker *c, Entity *e) {
is_invalid = true;
break;
case ProcOverload_Polymorphic:
#if 1
error(p->token, "Overloaded procedure `%.*s` has a polymorphic counterpart in this scope which is not allowed", LIT(name));
is_invalid = true;
#endif
break;
case ProcOverload_ParamCount:
case ProcOverload_ParamTypes:
@@ -1705,7 +1708,11 @@ void check_collect_entities(Checker *c, Array<AstNode *> nodes, bool is_file_sco
e->identifier = name;
if (fl != NULL && e->kind != Entity_Procedure) {
error(name, "Only procedures and variables are allowed to be in a foreign block, got %.*s", LIT(ast_node_strings[init->kind]));
AstNodeKind kind = init->kind;
error(name, "Only procedures and variables are allowed to be in a foreign block, got %.*s", LIT(ast_node_strings[kind]));
if (kind == AstNode_ProcType) {
gb_printf_err("\tDid you forget to append `---` to the procedure?\n");
}
// continue;
}