From de7ea04f54a13563e4a864093eccde5fe8a2bfbb Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 16 Jan 2022 18:13:24 +0100 Subject: [PATCH] when zp option = dontuse, print error for any variable with @requirezp --- compiler/src/prog8/compiler/astprocessing/AstChecker.kt | 3 +++ docs/source/todo.rst | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt index ac9c4154b..d3bfc76e3 100644 --- a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt +++ b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt @@ -640,6 +640,9 @@ internal class AstChecker(private val program: Program, err("string var can only be initialized with a string literal") } + if(compilerOptions.zeropage==ZeropageType.DONTUSE && decl.zeropage==ZeropageWish.REQUIRE_ZEROPAGE) + err("zeropage usage has been disabled by options") + super.visit(decl) } diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 5d816f6b1..c4523d5d0 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -3,7 +3,7 @@ TODO For next compiler release (7.7) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- if zp option = dontuse, give error if any variable has @requirezp +... Need help with ^^^^^^^^^^^^^^