Prevent defining invalid local labels

Fixes #913
This commit is contained in:
Rangi
2021-07-29 18:55:59 -04:00
committed by Eldred Habert
parent 20fd6eabbb
commit 26ddf1ff4d
14 changed files with 63 additions and 29 deletions

View File

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

View File

@@ -0,0 +1,7 @@
SECTION "sec", ROM0
Parent:
Parent.heir:
db 0
Parent...spare:
db 1

View File

@@ -0,0 +1,2 @@
FATAL: multiple-dots-local.asm(6):
'Parent...spare' is a nonsensical reference to a nested local label

View File

View File

@@ -0,0 +1,8 @@
SECTION "sec", ROM0
Parent:
Parent.child:
db 0
.grandchild:
db 1
dw Parent.child.grandchild

View File

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

View File

View File

@@ -0,0 +1,7 @@
SECTION "sec", ROM0
Parent:
Parent.child:
db 0
Parent.child.grandchild:
db 1

View File

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

View File

View File

@@ -4,4 +4,4 @@ Parent:
.child:
db 0
NotParent:
dw Parent.child.fail
dw Parent.orphan

View File

@@ -1,2 +0,0 @@
FATAL: remote-local-noexist.asm(7):
'Parent.child.fail' is a nonsensical reference to a nested local symbol

View File

@@ -3,7 +3,7 @@ ERROR: sym-scope.asm(4):
ERROR: sym-scope.asm(5):
Local label 'Nice.try' in main scope
ERROR: sym-scope.asm(17):
Not currently in the scope of 'Parentheses.check'
Not currently in the scope of 'Parentheses'
ERROR: sym-scope.asm(21):
Not currently in the scope of 'Parent.check'
Not currently in the scope of 'Parent'
error: Assembly aborted (4 errors)!