mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge pull request #5279 from Feoramund/fix-4673
Be strict with type switch case column alignment too
This commit is contained in:
@@ -1593,6 +1593,20 @@ gb_internal void check_type_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_
|
|||||||
error_line("\tSuggestion: Was '#partial switch' wanted?\n");
|
error_line("\tSuggestion: Was '#partial switch' wanted?\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (build_context.strict_style) {
|
||||||
|
Token stok = ss->token;
|
||||||
|
for_array(i, bs->stmts) {
|
||||||
|
Ast *stmt = bs->stmts[i];
|
||||||
|
if (stmt->kind != Ast_CaseClause) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Token ctok = stmt->CaseClause.token;
|
||||||
|
if (ctok.pos.column > stok.pos.column) {
|
||||||
|
error(ctok, "With '-strict-style', 'case' statements must share the same column as the 'switch' token");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gb_internal void check_block_stmt_for_errors(CheckerContext *ctx, Ast *body) {
|
gb_internal void check_block_stmt_for_errors(CheckerContext *ctx, Ast *body) {
|
||||||
|
|||||||
Reference in New Issue
Block a user