Add -strict-style-init-only

This commit is contained in:
gingerBill
2021-09-09 11:06:19 +01:00
parent 56bd1e2d70
commit e65e0b5db2
3 changed files with 18 additions and 1 deletions

View File

@@ -1516,6 +1516,8 @@ void assign_removal_flag_to_semicolon(AstFile *f) {
if (ok) {
if (build_context.strict_style) {
syntax_error(*prev_token, "Found unneeded semicolon");
} else if (build_context.strict_style_init_only && f->pkg->kind == Package_Init) {
syntax_error(*prev_token, "Found unneeded semicolon");
}
prev_token->flags |= TokenFlag_Remove;
}