mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Improve some error messages
This commit is contained in:
@@ -982,8 +982,11 @@ static void discardLineContinuation() {
|
|||||||
break;
|
break;
|
||||||
} else if (c == ';') {
|
} else if (c == ';') {
|
||||||
discardComment();
|
discardComment();
|
||||||
|
} else if (c == EOF) {
|
||||||
|
error("Invalid line continuation at end of file");
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
error("Begun line continuation, but encountered character %s", printChar(c));
|
error("Invalid character after line continuation %s", printChar(c));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ yy::parser::symbol_type yylex() {
|
|||||||
scriptError(context, "Unknown keyword \"%s\"", ident.c_str());
|
scriptError(context, "Unknown keyword \"%s\"", ident.c_str());
|
||||||
return yylex();
|
return yylex();
|
||||||
} else {
|
} else {
|
||||||
scriptError(context, "Unexpected character '%s'", printChar(c));
|
scriptError(context, "Unexpected character %s", printChar(c));
|
||||||
// Keep reading characters until the EOL, to avoid reporting too many errors.
|
// Keep reading characters until the EOL, to avoid reporting too many errors.
|
||||||
for (c = context.file.sgetc(); !isNewline(c); c = context.file.sgetc()) {
|
for (c = context.file.sgetc(); !isNewline(c); c = context.file.sgetc()) {
|
||||||
if (c == EOF) {
|
if (c == EOF) {
|
||||||
|
|||||||
1
test/asm/line-continuation-at-eof.asm
Normal file
1
test/asm/line-continuation-at-eof.asm
Normal file
@@ -0,0 +1 @@
|
|||||||
|
assert 1 + 1 == 2 \
|
||||||
3
test/asm/line-continuation-at-eof.err
Normal file
3
test/asm/line-continuation-at-eof.err
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
error: line-continuation-at-eof.asm(1):
|
||||||
|
Invalid line continuation at end of file
|
||||||
|
Assembly aborted with 1 error!
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
error: line-continuation.asm(3):
|
error: line-continuation.asm(3):
|
||||||
Begun line continuation, but encountered character 's'
|
Invalid character after line continuation 's'
|
||||||
warning: line-continuation.asm(6) -> line-continuation.asm::spam(4): [-Wuser]
|
warning: line-continuation.asm(6) -> line-continuation.asm::spam(4): [-Wuser]
|
||||||
spam
|
spam
|
||||||
error: line-continuation.asm(14):
|
error: line-continuation.asm(14):
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
error: macro-arg-0.asm(5) -> macro-arg-0.asm::m(2):
|
error: macro-arg-0.asm(5) -> macro-arg-0.asm::m(2):
|
||||||
Begun line continuation, but encountered character '0'
|
Invalid character after line continuation '0'
|
||||||
error: macro-arg-0.asm(5) -> macro-arg-0.asm::m(3):
|
error: macro-arg-0.asm(5) -> macro-arg-0.asm::m(3):
|
||||||
Invalid bracketed macro argument '\<0>'
|
Invalid bracketed macro argument '\<0>'
|
||||||
Assembly aborted with 2 errors!
|
Assembly aborted with 2 errors!
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
error: macro-arg-recursion.asm(6) -> macro-arg-recursion.asm::m(2):
|
error: macro-arg-recursion.asm(6) -> macro-arg-recursion.asm::m(2):
|
||||||
Begun line continuation, but encountered character '2'
|
Invalid character after line continuation '2'
|
||||||
Assembly aborted with 1 error!
|
Assembly aborted with 1 error!
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
error: null-outside-string.asm(3):
|
error: null-outside-string.asm(3):
|
||||||
Begun line continuation, but encountered character '0'
|
Invalid character after line continuation '0'
|
||||||
error: null-outside-string.asm(3):
|
error: null-outside-string.asm(3):
|
||||||
syntax error, unexpected number
|
syntax error, unexpected number
|
||||||
error: null-outside-string.asm(4):
|
error: null-outside-string.asm(4):
|
||||||
Begun line continuation, but encountered character '0'
|
Invalid character after line continuation '0'
|
||||||
error: null-outside-string.asm(4):
|
error: null-outside-string.asm(4):
|
||||||
syntax error, unexpected number
|
syntax error, unexpected number
|
||||||
error: null-outside-string.asm(6):
|
error: null-outside-string.asm(6):
|
||||||
Begun line continuation, but encountered character 'X'
|
Invalid character after line continuation 'X'
|
||||||
error: null-outside-string.asm(6):
|
error: null-outside-string.asm(6):
|
||||||
syntax error, unexpected symbol
|
syntax error, unexpected symbol
|
||||||
error: null-outside-string.asm(7):
|
error: null-outside-string.asm(7):
|
||||||
Begun line continuation, but encountered character 'X'
|
Invalid character after line continuation 'X'
|
||||||
error: null-outside-string.asm(7):
|
error: null-outside-string.asm(7):
|
||||||
syntax error, unexpected symbol
|
syntax error, unexpected symbol
|
||||||
Assembly aborted with 8 errors!
|
Assembly aborted with 8 errors!
|
||||||
|
|||||||
Reference in New Issue
Block a user