-
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add warning for `LOAD` without `ENDL`
- Loading branch information
Showing
21 changed files
with
147 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,7 @@ _rgbasm_completions() { | |
shift-amount | ||
truncation | ||
unmapped-char | ||
unterminated-load | ||
user | ||
all | ||
extra | ||
|
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
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
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
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
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,2 +1,5 @@ | ||
FATAL: endsection-in-load.asm(3): | ||
Cannot end the section within a `LOAD` block | ||
warning: endsection-in-load.asm(3): [-Wunterminated-load] | ||
`LOAD` block without `ENDL` terminated by `ENDSECTION` | ||
error: endsection-in-load.asm(4): | ||
Found `ENDL` outside of a `LOAD` block | ||
error: Assembly aborted (1 error)! |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
MACRO data | ||
db SECTION(@), \# | ||
ENDM | ||
|
||
MACRO now_in | ||
if strcmp("\1", "nothing") | ||
assert !strcmp(SECTION(@), \1) | ||
else | ||
assert !def(@) | ||
endc | ||
ENDM | ||
|
||
now_in nothing | ||
|
||
SECTION "A", ROM0 | ||
now_in "A" | ||
data 1 | ||
LOAD "P", WRAM0 | ||
now_in "P" | ||
data 2 | ||
|
||
; LOAD after LOAD | ||
LOAD "Q", WRAM0 | ||
now_in "Q" | ||
data 3 | ||
|
||
; SECTION after LOAD | ||
SECTION "B", ROM0 | ||
now_in "B" | ||
data 4 | ||
LOAD "R", WRAM0 | ||
now_in "R" | ||
data 5 | ||
|
||
; PUSHS after LOAD | ||
PUSHS | ||
SECTION "C", ROM0 | ||
now_in "C" | ||
data 6 | ||
LOAD "S", WRAM0 | ||
now_in "S" | ||
data 7 | ||
|
||
; POPS after LOAD | ||
POPS | ||
now_in "R" | ||
data 8 | ||
|
||
; ENDSECTION after LOAD | ||
ENDSECTION | ||
now_in nothing |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
warning: load-endings.asm(23): [-Wunterminated-load] | ||
`LOAD` block without `ENDL` terminated by `LOAD` | ||
warning: load-endings.asm(28): [-Wunterminated-load] | ||
`LOAD` block without `ENDL` terminated by `SECTION` | ||
warning: load-endings.asm(45): [-Wunterminated-load] | ||
`LOAD` block without `ENDL` terminated by `POPS` | ||
warning: load-endings.asm(50): [-Wunterminated-load] | ||
`LOAD` block without `ENDL` terminated by `ENDSECTION` |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
BRRAPQCS |
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,5 +1,5 @@ | ||
SECTION "outer", ROM0 | ||
LOAD "inner", WRAM0 | ||
LOAD "matryoshka", HRAM | ||
ENDL | ||
ENDL | ||
LOAD "inner1", WRAM0 ; starts "inner1" | ||
LOAD "inner2", HRAM ; ends "inner1", starts "inner2" | ||
ENDL ; ends "inner2" | ||
ENDL ; error |
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,5 +1,5 @@ | ||
error: load-in-load.asm(3): | ||
`LOAD` blocks cannot be nested | ||
warning: load-in-load.asm(3): [-Wunterminated-load] | ||
`LOAD` block without `ENDL` terminated by `LOAD` | ||
error: load-in-load.asm(5): | ||
Found `ENDL` outside of a `LOAD` block | ||
error: Assembly aborted (2 errors)! | ||
error: Assembly aborted (1 error)! |
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 @@ | ||
def p = {{a}} | ||
def q = "{b}" | ||
def r = "{{c}}" | ||
def r = "{{c}}" |
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,4 +1,4 @@ | ||
SECTION "outer", ROM0 | ||
SECTION "outer1", ROM0 | ||
LOAD "ram", WRAM0 | ||
SECTION "inner", ROM0 | ||
SECTION "outer2", ROM0 | ||
ENDL |
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,2 +1,5 @@ | ||
FATAL: section-in-load.asm(3): | ||
Cannot change the section within a `LOAD` block | ||
warning: section-in-load.asm(3): [-Wunterminated-load] | ||
`LOAD` block without `ENDL` terminated by `SECTION` | ||
error: section-in-load.asm(4): | ||
Found `ENDL` outside of a `LOAD` block | ||
error: Assembly aborted (1 error)! |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SECTION "rom", ROM0 | ||
LOAD "ram", WRAM0 |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
warning: unterminated-load.asm(3): [-Wunterminated-load] | ||
`LOAD` block without `ENDL` terminated by EOF |