mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Merge pull request #425 from ISSOtm/eexpansion_error
Add info about string expansions in error reports
This commit is contained in:
@@ -43,6 +43,7 @@ void fstk_RunInclude(char *tzFileName);
|
|||||||
void fstk_RunMacroArg(int32_t s);
|
void fstk_RunMacroArg(int32_t s);
|
||||||
void fstk_Init(char *s);
|
void fstk_Init(char *s);
|
||||||
void fstk_Dump(void);
|
void fstk_Dump(void);
|
||||||
|
void fstk_DumpStringExpansions(void);
|
||||||
void fstk_AddIncludePath(char *s);
|
void fstk_AddIncludePath(char *s);
|
||||||
uint32_t fstk_RunMacro(char *s);
|
uint32_t fstk_RunMacro(char *s);
|
||||||
void fstk_RunRept(uint32_t count, int32_t nReptLineNo);
|
void fstk_RunRept(uint32_t count, int32_t nReptLineNo);
|
||||||
|
|||||||
@@ -262,6 +262,20 @@ void fstk_Dump(void)
|
|||||||
fprintf(stderr, "%s(%d)", tzCurrentFileName, nLineNo);
|
fprintf(stderr, "%s(%d)", tzCurrentFileName, nLineNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Dump the string expansion stack to stderr
|
||||||
|
*/
|
||||||
|
void fstk_DumpStringExpansions(void)
|
||||||
|
{
|
||||||
|
const struct sStringExpansionPos *pExpansion = pCurrentStringExpansion;
|
||||||
|
|
||||||
|
while (pExpansion) {
|
||||||
|
fprintf(stderr, "while expanding symbol \"%s\"\n",
|
||||||
|
pExpansion->tzName);
|
||||||
|
pExpansion = pExpansion->pParent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Extra includepath stuff
|
* Extra includepath stuff
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -239,12 +239,13 @@ static void opt_ParseDefines(void)
|
|||||||
*/
|
*/
|
||||||
void verror(const char *fmt, va_list args)
|
void verror(const char *fmt, va_list args)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: ");
|
fputs("ERROR: ", stderr);
|
||||||
fstk_Dump();
|
fstk_Dump();
|
||||||
fprintf(stderr, ":\n ");
|
fputs(":\n ", stderr);
|
||||||
vfprintf(stderr, fmt, args);
|
vfprintf(stderr, fmt, args);
|
||||||
fprintf(stderr, "\n");
|
fputc('\n', stderr);
|
||||||
nErrors += 1;
|
fstk_DumpStringExpansions();
|
||||||
|
nErrors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void yyerror(const char *fmt, ...)
|
void yyerror(const char *fmt, ...)
|
||||||
@@ -276,11 +277,12 @@ void warning(const char *fmt, ...)
|
|||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
|
|
||||||
fprintf(stderr, "warning: ");
|
fputs("warning: ", stderr);
|
||||||
fstk_Dump();
|
fstk_Dump();
|
||||||
fprintf(stderr, ":\n ");
|
fputs(":\n ", stderr);
|
||||||
vfprintf(stderr, fmt, args);
|
vfprintf(stderr, fmt, args);
|
||||||
fprintf(stderr, "\n");
|
fputc('\n', stderr);
|
||||||
|
fstk_DumpStringExpansions();
|
||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,66 @@
|
|||||||
ERROR: equs-recursion.asm(2):
|
ERROR: equs-recursion.asm(2):
|
||||||
Recursion limit (64) exceeded
|
Recursion limit (64) exceeded
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
while expanding symbol "recurse"
|
||||||
|
|||||||
Reference in New Issue
Block a user