forked from gbdev/rgbds
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow defining local labels for another scope
fix gbdev#1157 for the following source code ``` section "hSAVE_locals",HRAM func3.hSpam: ds 1 ; no longer produces an error ;.hEggs: ds 1 ; uncomment this to see the new error section "demo",ROM0 func3: ldh a, [.hSpam] ret ``` Remove two errors: - `Not currently in the scope of 'func3'` - `Local label 'func3.hSpam' in main scope` Add one error: - `Relative local label '.hSpam' in main scope` Add a switch to restore previous behavior in `include/asm/symbol.h` ```c ``` update tests of local label definition failure now that local label definition is more lenient, fewer tests should fail begin removing issue number from test Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> treat ALLOW_LOCAL_LABEL_ANYWHERE as always on - don't gate the new lenient behavior behind a build-time condition - change "Relative local label" to "Unqualified local label" in an error message realign tests of local labels with wrong parent - repurpose test/asm/sym-scope from a test of producing correct errors to a successful test - remove test/asm/local-wrong-parent because it is now a redundant successful test based on suggestions by @Rangi42
- Loading branch information
Showing
7 changed files
with
14 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
error: local-without-parent.asm(2): | ||
Local label '.test' in main scope | ||
Unqualified local label '.test' in main scope | ||
error: Assembly aborted (1 error)! |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +0,0 @@ | ||
error: sym-scope.asm(4): | ||
Local label '.tooSoon' in main scope | ||
error: sym-scope.asm(5): | ||
Local label 'Nice.try' in main scope | ||
error: sym-scope.asm(17): | ||
Not currently in the scope of 'Parentheses' | ||
error: sym-scope.asm(21): | ||
Not currently in the scope of 'Parent' | ||
error: Assembly aborted (4 errors)! | ||