mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Make fatalerror and yyerror consistent
There are two ways in which the assembly process can fail: 1. If there is a really big problem that compromises the whole process, the assembler has to stop right there and generate an error message. This happens with unterminated REPT loops, macros, etc. 2. If the problem isn't that big and the process can still continue, even though the final result is invalid, the assembler can try to continue and warn the user about all errors it finds in the code. This patch clarifies the use of each function and replaces the function used in two places by the correct one. Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -26,8 +26,25 @@ extern void opt_Push(void);
|
||||
extern void opt_Pop(void);
|
||||
extern void opt_Parse(char *s);
|
||||
|
||||
/*
|
||||
* Used for errors that compromise the whole assembly process by affecting the
|
||||
* folliwing code, potencially making the assembler generate errors caused by
|
||||
* the first one and unrelated to the code that the assembler complains about.
|
||||
* It is also used when the assembler goes into an invalid state (for example,
|
||||
* when it fails to allocate memory).
|
||||
*/
|
||||
noreturn void fatalerror(const char *fmt, ...);
|
||||
/*
|
||||
* Used for errors that make it impossible to assemble correctly, but don't
|
||||
* affect the following code. The code will fail to assemble but the user will
|
||||
* get a list of all errors at the end, making it easier to fix all of them at
|
||||
* once.
|
||||
*/
|
||||
void yyerror(const char *fmt, ...);
|
||||
/*
|
||||
* Used to warn the user about problems that don't prevent the generation of
|
||||
* valid code.
|
||||
*/
|
||||
void warning(const char *fmt, ...);
|
||||
|
||||
#define YY_FATAL_ERROR fatalerror
|
||||
|
||||
Reference in New Issue
Block a user