mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
macro_UndefUniqueID uses 0 to mean \@ is undefined
This commit is contained in:
@@ -31,6 +31,7 @@ uint32_t macro_GetUniqueID(void);
|
||||
char const *macro_GetUniqueIDStr(void);
|
||||
void macro_SetUniqueID(uint32_t id);
|
||||
uint32_t macro_UseNewUniqueID(void);
|
||||
uint32_t macro_UndefUniqueID(void);
|
||||
void macro_ShiftCurrentArgs(int32_t count);
|
||||
uint32_t macro_NbArgs(void);
|
||||
|
||||
|
||||
@@ -336,8 +336,7 @@ void fstk_RunInclude(char const *path)
|
||||
fatalerror("Failed to set up lexer for file include\n");
|
||||
lexer_SetStateAtEOL(contextStack->lexerState);
|
||||
// We're back at top-level, so most things are reset
|
||||
contextStack->uniqueID = 0;
|
||||
macro_SetUniqueID(0);
|
||||
contextStack->uniqueID = macro_UndefUniqueID();
|
||||
}
|
||||
|
||||
void fstk_RunMacro(char const *macroName, struct MacroArgs *args)
|
||||
@@ -539,8 +538,7 @@ void fstk_Init(char const *mainPath, size_t maxDepth)
|
||||
|
||||
context->parent = NULL;
|
||||
context->lexerState = state;
|
||||
context->uniqueID = 0;
|
||||
macro_SetUniqueID(0);
|
||||
context->uniqueID = macro_UndefUniqueID();
|
||||
context->nbReptIters = 0;
|
||||
context->forValue = 0;
|
||||
context->forStep = 0;
|
||||
|
||||
@@ -166,7 +166,13 @@ void macro_SetUniqueID(uint32_t id)
|
||||
uint32_t macro_UseNewUniqueID(void)
|
||||
{
|
||||
macro_SetUniqueID(++maxUniqueID);
|
||||
return maxUniqueID;
|
||||
return uniqueID;
|
||||
}
|
||||
|
||||
uint32_t macro_UndefUniqueID(void)
|
||||
{
|
||||
macro_SetUniqueID(0);
|
||||
return uniqueID;
|
||||
}
|
||||
|
||||
void macro_ShiftCurrentArgs(int32_t count)
|
||||
|
||||
Reference in New Issue
Block a user