Rephrase error messages for consistency

This commit is contained in:
Rangi42
2024-09-09 09:14:33 -04:00
committed by Eldred Habert
parent 155e7287db
commit 6bc2446966
11 changed files with 19 additions and 19 deletions

View File

@@ -377,7 +377,7 @@ void lexer_IncIFDepth() {
void lexer_DecIFDepth() { void lexer_DecIFDepth() {
if (lexerState->ifStack.empty()) if (lexerState->ifStack.empty())
fatalerror("Found ENDC outside an IF construct\n"); fatalerror("Found ENDC outside of an IF construct\n");
lexerState->ifStack.pop_front(); lexerState->ifStack.pop_front();
} }

View File

@@ -484,7 +484,7 @@ if:
elif: elif:
POP_ELIF const NEWLINE { POP_ELIF const NEWLINE {
if (lexer_GetIFDepth() == 0) if (lexer_GetIFDepth() == 0)
fatalerror("Found ELIF outside an IF construct\n"); fatalerror("Found ELIF outside of an IF construct\n");
if (lexer_RanIFBlock()) { if (lexer_RanIFBlock()) {
if (lexer_ReachedELSEBlock()) if (lexer_ReachedELSEBlock())
@@ -502,7 +502,7 @@ elif:
else: else:
POP_ELSE NEWLINE { POP_ELSE NEWLINE {
if (lexer_GetIFDepth() == 0) if (lexer_GetIFDepth() == 0)
fatalerror("Found ELSE outside an IF construct\n"); fatalerror("Found ELSE outside of an IF construct\n");
if (lexer_RanIFBlock()) { if (lexer_RanIFBlock()) {
if (lexer_ReachedELSEBlock()) if (lexer_ReachedELSEBlock())

View File

@@ -71,7 +71,7 @@ void Expression::makeNumber(uint32_t value) {
void Expression::makeSymbol(std::string const &symName) { void Expression::makeSymbol(std::string const &symName) {
clear(); clear();
if (Symbol *sym = sym_FindScopedSymbol(symName); sym_IsPC(sym) && !sect_GetSymbolSection()) { if (Symbol *sym = sym_FindScopedSymbol(symName); sym_IsPC(sym) && !sect_GetSymbolSection()) {
error("PC has no value outside a section\n"); error("PC has no value outside of a section\n");
data = 0; data = 0;
} else if (!sym || !sym->isConstant()) { } else if (!sym || !sym->isConstant()) {
isSymbol = true; isSymbol = true;
@@ -98,7 +98,7 @@ void Expression::makeBankSymbol(std::string const &symName) {
if (Symbol const *sym = sym_FindScopedSymbol(symName); sym_IsPC(sym)) { if (Symbol const *sym = sym_FindScopedSymbol(symName); sym_IsPC(sym)) {
// The @ symbol is treated differently. // The @ symbol is treated differently.
if (!currentSection) { if (!currentSection) {
error("PC has no bank outside a section\n"); error("PC has no bank outside of a section\n");
data = 1; data = 1;
} else if (currentSection->bank == (uint32_t)-1) { } else if (currentSection->bank == (uint32_t)-1) {
data = "Current section's bank is not known"; data = "Current section's bank is not known";

View File

@@ -45,7 +45,7 @@ static int32_t Callback_NARG() {
if (MacroArgs const *macroArgs = fstk_GetCurrentMacroArgs(); macroArgs) { if (MacroArgs const *macroArgs = fstk_GetCurrentMacroArgs(); macroArgs) {
return macroArgs->nbArgs(); return macroArgs->nbArgs();
} else { } else {
error("_NARG does not make sense outside of a macro\n"); error("_NARG has no value outside of a macro\n");
return 0; return 0;
} }
} }
@@ -145,11 +145,11 @@ Symbol *sym_FindScopedSymbol(std::string const &symName) {
Symbol *sym_FindScopedValidSymbol(std::string const &symName) { Symbol *sym_FindScopedValidSymbol(std::string const &symName) {
Symbol *sym = sym_FindScopedSymbol(symName); Symbol *sym = sym_FindScopedSymbol(symName);
// `@` has no value outside a section // `@` has no value outside of a section
if (sym_IsPC(sym) && !sect_GetSymbolSection()) { if (sym_IsPC(sym) && !sect_GetSymbolSection()) {
return nullptr; return nullptr;
} }
// `_NARG` has no value outside a macro // `_NARG` has no value outside of a macro
if (sym == _NARGSymbol && !fstk_GetCurrentMacroArgs()) { if (sym == _NARGSymbol && !fstk_GetCurrentMacroArgs()) {
return nullptr; return nullptr;
} }
@@ -205,9 +205,9 @@ uint32_t sym_GetPCValue() {
Section const *sect = sect_GetSymbolSection(); Section const *sect = sect_GetSymbolSection();
if (!sect) if (!sect)
error("PC has no value outside a section\n"); error("PC has no value outside of a section\n");
else if (sect->org == (uint32_t)-1) else if (sect->org == (uint32_t)-1)
error("Expected constant PC but section is not fixed\n"); error("PC does not have a constant value; the current section is not fixed\n");
else else
return CallbackPC(); return CallbackPC();
return 0; return 0;

View File

@@ -267,7 +267,7 @@ static int32_t computeRPNExpr(Patch const &patch, std::vector<Symbol> const &fil
case RPN_BANK_SELF: case RPN_BANK_SELF:
if (!patch.pcSection) { if (!patch.pcSection) {
error(patch.src, patch.lineNo, "PC has no bank outside a section"); error(patch.src, patch.lineNo, "PC has no bank outside of a section");
isError = true; isError = true;
value = 1; value = 1;
} else { } else {
@@ -374,7 +374,7 @@ static int32_t computeRPNExpr(Patch const &patch, std::vector<Symbol> const &fil
if (value == -1) { // PC if (value == -1) { // PC
if (!patch.pcSection) { if (!patch.pcSection) {
error(patch.src, patch.lineNo, "PC has no value outside a section"); error(patch.src, patch.lineNo, "PC has no value outside of a section");
value = 0; value = 0;
isError = true; isError = true;
} else { } else {

View File

@@ -1,3 +1,3 @@
error: assert-nosect-bank.asm(1): error: assert-nosect-bank.asm(1):
PC has no bank outside a section PC has no bank outside of a section
error: Assembly aborted (1 error)! error: Assembly aborted (1 error)!

View File

@@ -1,3 +1,3 @@
error: assert@-no-sect.asm(1): error: assert@-no-sect.asm(1):
PC has no value outside a section PC has no value outside of a section
error: Assembly aborted (1 error)! error: Assembly aborted (1 error)!

View File

@@ -3,5 +3,5 @@ error: bracketed-symbols.asm(16):
error: bracketed-symbols.asm(20): error: bracketed-symbols.asm(20):
"Label" does not have a constant value "Label" does not have a constant value
error: bracketed-symbols.asm(21): error: bracketed-symbols.asm(21):
Expected constant PC but section is not fixed PC does not have a constant value; the current section is not fixed
error: Assembly aborted (3 errors)! error: Assembly aborted (3 errors)!

View File

@@ -1,5 +1,5 @@
error: const-and.asm(2): error: const-and.asm(2):
PC has no value outside a section PC has no value outside of a section
error: const-and.asm(11): error: const-and.asm(11):
Expected constant expression: 'Aligned' is not constant at assembly time Expected constant expression: 'Aligned' is not constant at assembly time
error: const-and.asm(17): error: const-and.asm(17):

View File

@@ -1,2 +1,2 @@
FATAL: endc-outside-if.asm(1): FATAL: endc-outside-if.asm(1):
Found ENDC outside an IF construct Found ENDC outside of an IF construct

View File

@@ -1,9 +1,9 @@
error: undefined-builtins.asm(3): error: undefined-builtins.asm(3):
PC has no value outside a section PC has no value outside of a section
error: undefined-builtins.asm(4): error: undefined-builtins.asm(4):
Interpolated symbol "@" does not exist Interpolated symbol "@" does not exist
error: undefined-builtins.asm(8): error: undefined-builtins.asm(8):
_NARG does not make sense outside of a macro _NARG has no value outside of a macro
error: undefined-builtins.asm(9): error: undefined-builtins.asm(9):
Interpolated symbol "_NARG" does not exist Interpolated symbol "_NARG" does not exist
error: Assembly aborted (4 errors)! error: Assembly aborted (4 errors)!