From 592becc126996b36027053aa44acdbdce2ef7d69 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Tue, 19 Mar 2024 23:31:21 +0100 Subject: [PATCH] allow %breakpoint also in if/else blocks and other anonymous scopes --- compiler/src/prog8/compiler/astprocessing/AstChecker.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt index 5da841549..f507dc420 100644 --- a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt +++ b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt @@ -825,7 +825,7 @@ internal class AstChecker(private val program: Program, err("invalid import directive, cannot import itself") } "%breakpoint" -> { - if(directive.parent !is INameScope || directive.parent is Module) + if(directive.parent !is INameScope && directive.parent !is AnonymousScope || directive.parent is Module) err("this directive can't be used here") if(directive.args.isNotEmpty()) err("invalid breakpoint directive, expected no arguments")