mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Improve error stack
The old error stack was fairly obtuse and hard to use for debugging. This improves it notably by ensuring all line numbers are relative to the file, and not, say, the macro definition. This is a breaking change if you were parsing the old stack, but the change should be painless, and the new stack only brings more info. The syntax is unchanged for files, macros see their name prefixed with the file they're defined in and a pair of colors, REPT blocks simply append a '::REPT~n' to the context they're in, where 'n' is the number of iterations the REPT has done. This is especially helpful in macro-heavy code such as rgbds-structs.
This commit is contained in:
@@ -33,6 +33,8 @@ struct sContext {
|
||||
char *pREPTBlock;
|
||||
uint32_t nREPTBlockCount;
|
||||
uint32_t nREPTBlockSize;
|
||||
int32_t nREPTBodyFirstLine;
|
||||
int32_t nREPTBodyLastLine;
|
||||
};
|
||||
|
||||
extern unsigned int nMaxRecursionDepth;
|
||||
@@ -43,7 +45,7 @@ void fstk_Init(char *s);
|
||||
void fstk_Dump(void);
|
||||
void fstk_AddIncludePath(char *s);
|
||||
uint32_t fstk_RunMacro(char *s);
|
||||
void fstk_RunRept(uint32_t count);
|
||||
void fstk_RunRept(uint32_t count, int32_t nReptLineNo);
|
||||
FILE *fstk_FindFile(char *fname, char **incPathUsed);
|
||||
int32_t fstk_GetLine(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user