Add -vet-style and -vet-semicolon

This commit is contained in:
gingerBill
2023-08-01 11:03:15 +01:00
parent 4b57aec1c6
commit c35c58b023
4 changed files with 77 additions and 38 deletions

View File

@@ -2261,7 +2261,7 @@ gb_internal bool check_is_not_addressable(CheckerContext *c, Operand *o) {
}
gb_internal void check_old_for_or_switch_value_usage(Ast *expr) {
if (!build_context.strict_style) {
if (!(build_context.strict_style || (check_vet_flags(expr) & VetFlag_Style))) {
return;
}
@@ -2351,7 +2351,7 @@ gb_internal void check_unary_expr(CheckerContext *c, Operand *o, Token op, Ast *
o->type = alloc_type_pointer(o->type);
}
} else {
if (build_context.strict_style && ast_node_expect(node, Ast_UnaryExpr)) {
if (ast_node_expect(node, Ast_UnaryExpr)) {
ast_node(ue, UnaryExpr, node);
check_old_for_or_switch_value_usage(ue->expr);
}