add new and init to toolchain

This commit is contained in:
2026-07-04 17:38:45 +02:00
parent cdde49e68b
commit e7f69ffb5a
17 changed files with 711 additions and 63 deletions
+14 -1
View File
@@ -616,9 +616,22 @@ add_label_shadow_diagnostic :: proc(ctx: ^Build_Ctx, span: source.Span, label: s
if !symbol.is_valid(label) {
return source.INVALID_DIAGNOSTIC
}
yield_targets := ctx.yield_targets^[:]
if len(yield_targets) > 0 && yield_targets[len(yield_targets) - 1].label == label {
label_is_active_loop := false
for loop_label in ctx.loop_labels^[:] {
if loop_label == label {
label_is_active_loop = true
break
}
}
if !label_is_active_loop {
yield_targets = yield_targets[:len(yield_targets) - 1]
}
}
return add_shadow_diagnostic(
ctx.checker, span, label, "label",
ctx.pkg, ctx.file, ctx.locals^[:], ctx.loop_labels^[:], ctx.yield_targets^[:],
ctx.pkg, ctx.file, ctx.locals^[:], ctx.loop_labels^[:], yield_targets,
)
}