Consistently handle auto-scoping of local symbols

This commit is contained in:
Rangi42
2024-09-09 11:31:42 -04:00
committed by Eldred Habert
parent cff05435ad
commit 6e83a14143
14 changed files with 60 additions and 57 deletions

View File

@@ -0,0 +1,3 @@
SECTION "Test", ROM0
PURGE .test

View File

@@ -0,0 +1,2 @@
FATAL: empty-local-purged.asm(3):
Unqualified local label '.test' in main scope

View File

@@ -0,0 +1,3 @@
SECTION "Test", ROM0
dw Referenced.

View File

@@ -0,0 +1,2 @@
FATAL: empty-local-referenced.asm(3):
'Referenced.' is a nonsensical reference to an empty local label

View File

@@ -0,0 +1,4 @@
SECTION "Test", ROM0
Label:
dw Label.

View File

@@ -0,0 +1,2 @@
FATAL: empty-local-used.asm(4):
'Label.' is a nonsensical reference to an empty local label

View File

@@ -1,4 +1,3 @@
SECTION "Test", ROM0
Label:

View File

@@ -1,2 +1,2 @@
FATAL: empty-local.asm(5):
FATAL: empty-local.asm(4):
'Label.' is a nonsensical reference to an empty local label

View File

@@ -1,3 +1,3 @@
SECTION "sec", ROM0
SECTION "Test", ROM0
dw .test

View File

@@ -1,2 +1,2 @@
FATAL: local-ref-without-parent.asm(3):
Local label reference '.test' in main scope
Unqualified local label '.test' in main scope

View File

@@ -1,2 +1,3 @@
SECTION "Test", ROM0
.test:

View File

@@ -1,3 +1,2 @@
error: local-without-parent.asm(2):
FATAL: local-without-parent.asm(3):
Unqualified local label '.test' in main scope
error: Assembly aborted (1 error)!

View File

@@ -1,2 +1,2 @@
FATAL: nested-local-reference.asm(8):
'Parent.child.grandchild' is a nonsensical reference to a nested local symbol
'Parent.child.grandchild' is a nonsensical reference to a nested local label