From fcd4c9a267b407e653ed6b21ae87f219f3e4c4af Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 18 Aug 2026 16:39:37 +0200 Subject: Add global labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are labels that are declared by prefixing a '#' symbol to the name, and it allows the label to be declared at the global scope instead of the current one. This is a feature which is not to be abused so to not make scopes pointless, but it can be quite handy with some optimizations while not abandoning scopes completely. Signed-off-by: Miquel Sabaté Solà --- scripts/test-e2e.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/test-e2e.sh b/scripts/test-e2e.sh index 0620f25..6e18644 100755 --- a/scripts/test-e2e.sh +++ b/scripts/test-e2e.sh @@ -140,6 +140,13 @@ exit_code=$((exit_code + $?)) diff tests/out/fixed-segments.nes tests/expected/fixed-segments.nes exit_code=$((exit_code + $?)) +echo "test: custom => global-labels.nes" +./target/debug/nasm -c empty -Werror --asan -o tests/out/global-labels.nes tests/global-labels.s 2>tests/out/global-labels.txt +diff tests/out/global-labels.txt tests/expected/global-labels.txt +exit_code=$((exit_code + $?)) +diff tests/out/global-labels.nes tests/expected/global-labels.nes +exit_code=$((exit_code + $?)) + ## # code.nes -- cgit v1.2.3