mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Return a consistent number for const BANK() when erroring out
This commit is contained in:
@@ -40,15 +40,14 @@ void constexpr_Symbol(struct ConstExpression *expr, char *tzSym)
|
|||||||
|
|
||||||
void constexpr_BankSymbol(struct ConstExpression *expr, char *tzSym)
|
void constexpr_BankSymbol(struct ConstExpression *expr, char *tzSym)
|
||||||
{
|
{
|
||||||
|
constexpr_Number(expr, 0);
|
||||||
|
|
||||||
if (sym_FindSymbol(tzSym) == pPCSymbol) {
|
if (sym_FindSymbol(tzSym) == pPCSymbol) {
|
||||||
if (pCurrentSection->nBank == -1)
|
if (pCurrentSection->nBank == -1)
|
||||||
yyerror("%s's bank is not known yet", tzSym);
|
yyerror("%s's bank is not known yet", tzSym);
|
||||||
else
|
else
|
||||||
constexpr_Number(expr, pCurrentSection->nBank);
|
constexpr_Number(expr, pCurrentSection->nBank);
|
||||||
return;
|
} else if (sym_isConstant(tzSym)) {
|
||||||
}
|
|
||||||
|
|
||||||
if (sym_isConstant(tzSym)) {
|
|
||||||
yyerror("BANK argument must be a relocatable identifier");
|
yyerror("BANK argument must be a relocatable identifier");
|
||||||
} else {
|
} else {
|
||||||
struct sSymbol *pSymbol = sym_FindSymbol(tzSym);
|
struct sSymbol *pSymbol = sym_FindSymbol(tzSym);
|
||||||
@@ -64,6 +63,7 @@ void constexpr_BankSymbol(struct ConstExpression *expr, char *tzSym)
|
|||||||
|
|
||||||
void constexpr_BankSection(struct ConstExpression *expr, char *tzSectionName)
|
void constexpr_BankSection(struct ConstExpression *expr, char *tzSectionName)
|
||||||
{
|
{
|
||||||
|
constexpr_Number(expr, 0);
|
||||||
struct Section *pSection = out_FindSectionByName(tzSectionName);
|
struct Section *pSection = out_FindSectionByName(tzSectionName);
|
||||||
|
|
||||||
if (!pSection)
|
if (!pSection)
|
||||||
|
|||||||
@@ -2,5 +2,4 @@ ERROR: pc-bank.asm(2):
|
|||||||
Source address $2a00 not in $FF00 to $FFFF
|
Source address $2a00 not in $FF00 to $FFFF
|
||||||
ERROR: pc-bank.asm(11):
|
ERROR: pc-bank.asm(11):
|
||||||
@'s bank is not known yet
|
@'s bank is not known yet
|
||||||
ERROR: pc-bank.asm(11):
|
error: Assembly aborted (2 errors)!
|
||||||
Non-constant expression
|
|
||||||
|
|||||||
Reference in New Issue
Block a user