Add separate -vet flags; -vet-using-* flags; //+vet file flags

This commit is contained in:
gingerBill
2023-07-31 11:09:19 +01:00
parent 551c379f1b
commit 60e509b1e0
11 changed files with 204 additions and 22 deletions
+6
View File
@@ -2464,6 +2464,12 @@ gb_internal void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags)
error(us->token, "Empty 'using' list");
return;
}
if (check_vet_flags(ctx) & VetFlag_UsingStmt) {
ERROR_BLOCK();
error(node, "'using' as a statement is now allowed when '-vet' or '-vet-using' is applied");
error_line("\t'using' is considered bad practice to use as a statement outside of immediate refactoring\n");
}
for (Ast *expr : us->list) {
expr = unparen_expr(expr);
Entity *e = nullptr;