add new and init to toolchain
This commit is contained in:
@@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user