mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Revert 97d431d1f4ad404e282e3781bd195be3f053734d; it breaks things.
This commit is contained in:
@@ -24,7 +24,7 @@ extern ULONG nTotalLines;
|
|||||||
extern ULONG nPC;
|
extern ULONG nPC;
|
||||||
extern ULONG nPass;
|
extern ULONG nPass;
|
||||||
extern ULONG nIFDepth;
|
extern ULONG nIFDepth;
|
||||||
extern char *tzCurrentFileName;
|
extern char tzCurrentFileName[_MAX_PATH + 1];
|
||||||
extern struct Section *pCurrentSection;
|
extern struct Section *pCurrentSection;
|
||||||
extern struct sSymbol *tHashedSymbols[HASHSIZE];
|
extern struct sSymbol *tHashedSymbols[HASHSIZE];
|
||||||
extern struct sSymbol *pPCSymbol;
|
extern struct sSymbol *pPCSymbol;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ struct sContext {
|
|||||||
YY_BUFFER_STATE FlexHandle;
|
YY_BUFFER_STATE FlexHandle;
|
||||||
struct sSymbol *pMacro;
|
struct sSymbol *pMacro;
|
||||||
struct sContext *pNext;
|
struct sContext *pNext;
|
||||||
char *tzFileName;
|
char tzFileName[_MAX_PATH + 1];
|
||||||
char *tzMacroArgs[MAXMACROARGS + 1];
|
char *tzMacroArgs[MAXMACROARGS + 1];
|
||||||
SLONG nLine;
|
SLONG nLine;
|
||||||
ULONG nStatus;
|
ULONG nStatus;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ struct sSymbol *pCurrentMacro;
|
|||||||
YY_BUFFER_STATE CurrentFlexHandle;
|
YY_BUFFER_STATE CurrentFlexHandle;
|
||||||
FILE *pCurrentFile;
|
FILE *pCurrentFile;
|
||||||
ULONG nCurrentStatus;
|
ULONG nCurrentStatus;
|
||||||
char *tzCurrentFileName;
|
char tzCurrentFileName[_MAX_PATH + 1];
|
||||||
char IncludePaths[MAXINCPATHS][_MAX_PATH + 1];
|
char IncludePaths[MAXINCPATHS][_MAX_PATH + 1];
|
||||||
SLONG NextIncPath = 0;
|
SLONG NextIncPath = 0;
|
||||||
ULONG nMacroCount;
|
ULONG nMacroCount;
|
||||||
@@ -70,7 +70,8 @@ pushcontext(void)
|
|||||||
(struct sContext *) malloc(sizeof(struct sContext))) != NULL) {
|
(struct sContext *) malloc(sizeof(struct sContext))) != NULL) {
|
||||||
(*ppFileStack)->FlexHandle = CurrentFlexHandle;
|
(*ppFileStack)->FlexHandle = CurrentFlexHandle;
|
||||||
(*ppFileStack)->pNext = NULL;
|
(*ppFileStack)->pNext = NULL;
|
||||||
(*ppFileStack)->tzFileName = tzCurrentFileName;
|
strcpy((char *) (*ppFileStack)->tzFileName,
|
||||||
|
(char *) tzCurrentFileName);
|
||||||
(*ppFileStack)->nLine = nLineNo;
|
(*ppFileStack)->nLine = nLineNo;
|
||||||
switch ((*ppFileStack)->nStatus = nCurrentStatus) {
|
switch ((*ppFileStack)->nStatus = nCurrentStatus) {
|
||||||
case STAT_isMacroArg:
|
case STAT_isMacroArg:
|
||||||
@@ -131,7 +132,8 @@ popcontext(void)
|
|||||||
nLineNo += 1;
|
nLineNo += 1;
|
||||||
|
|
||||||
CurrentFlexHandle = pLastFile->FlexHandle;
|
CurrentFlexHandle = pLastFile->FlexHandle;
|
||||||
tzCurrentFileName = pLastFile->tzFileName;
|
strcpy((char *) tzCurrentFileName,
|
||||||
|
(char *) pLastFile->tzFileName);
|
||||||
switch (nCurrentStatus = pLastFile->nStatus) {
|
switch (nCurrentStatus = pLastFile->nStatus) {
|
||||||
case STAT_isMacroArg:
|
case STAT_isMacroArg:
|
||||||
case STAT_isMacro:
|
case STAT_isMacro:
|
||||||
@@ -247,7 +249,7 @@ fstk_RunInclude(char *tzFileName)
|
|||||||
pushcontext();
|
pushcontext();
|
||||||
nLineNo = 1;
|
nLineNo = 1;
|
||||||
nCurrentStatus = STAT_isInclude;
|
nCurrentStatus = STAT_isInclude;
|
||||||
tzCurrentFileName = tzFileName;
|
strcpy(tzCurrentFileName, tzFileName);
|
||||||
pCurrentFile = f;
|
pCurrentFile = f;
|
||||||
CurrentFlexHandle = yy_create_buffer(pCurrentFile);
|
CurrentFlexHandle = yy_create_buffer(pCurrentFile);
|
||||||
yy_switch_to_buffer(CurrentFlexHandle);
|
yy_switch_to_buffer(CurrentFlexHandle);
|
||||||
@@ -275,7 +277,7 @@ fstk_RunMacro(char *s)
|
|||||||
nLineNo = -1;
|
nLineNo = -1;
|
||||||
sym_UseNewMacroArgs();
|
sym_UseNewMacroArgs();
|
||||||
nCurrentStatus = STAT_isMacro;
|
nCurrentStatus = STAT_isMacro;
|
||||||
tzCurrentFileName = s;
|
strcpy(tzCurrentFileName, s);
|
||||||
pCurrentMacro = sym;
|
pCurrentMacro = sym;
|
||||||
CurrentFlexHandle =
|
CurrentFlexHandle =
|
||||||
yy_scan_bytes(pCurrentMacro->pMacro,
|
yy_scan_bytes(pCurrentMacro->pMacro,
|
||||||
@@ -285,7 +287,32 @@ fstk_RunMacro(char *s)
|
|||||||
} else
|
} else
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* RGBAsm - FSTACK.C (FileStack routines)
|
||||||
|
*
|
||||||
|
* Set up a macroargument for parsing
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
fstk_RunMacroArg(SLONG s)
|
||||||
|
{
|
||||||
|
char *sym;
|
||||||
|
|
||||||
|
if (s == '@')
|
||||||
|
s = -1;
|
||||||
|
else
|
||||||
|
s -= '0';
|
||||||
|
|
||||||
|
if ((sym = sym_FindMacroArg(s)) != NULL) {
|
||||||
|
pushcontext();
|
||||||
|
nCurrentStatus = STAT_isMacroArg;
|
||||||
|
sprintf(tzCurrentFileName, "%c", (UBYTE) s);
|
||||||
|
CurrentFlexHandle = yy_scan_bytes(sym, strlen(sym));
|
||||||
|
yy_switch_to_buffer(CurrentFlexHandle);
|
||||||
|
} else
|
||||||
|
fatalerror("No such macroargument");
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* RGBAsm - FSTACK.C (FileStack routines)
|
* RGBAsm - FSTACK.C (FileStack routines)
|
||||||
*
|
*
|
||||||
@@ -301,7 +328,7 @@ fstk_RunString(char *s)
|
|||||||
if ((pSym = sym_FindSymbol(s)) != NULL) {
|
if ((pSym = sym_FindSymbol(s)) != NULL) {
|
||||||
pushcontext();
|
pushcontext();
|
||||||
nCurrentStatus = STAT_isMacroArg;
|
nCurrentStatus = STAT_isMacroArg;
|
||||||
tzCurrentFileName = s;
|
strcpy(tzCurrentFileName, s);
|
||||||
CurrentFlexHandle =
|
CurrentFlexHandle =
|
||||||
yy_scan_bytes(pSym->pMacro, strlen(pSym->pMacro));
|
yy_scan_bytes(pSym->pMacro, strlen(pSym->pMacro));
|
||||||
yy_switch_to_buffer(CurrentFlexHandle);
|
yy_switch_to_buffer(CurrentFlexHandle);
|
||||||
@@ -355,7 +382,7 @@ fstk_Init(char *s)
|
|||||||
|
|
||||||
nMacroCount = 0;
|
nMacroCount = 0;
|
||||||
nCurrentStatus = STAT_isInclude;
|
nCurrentStatus = STAT_isInclude;
|
||||||
tzCurrentFileName = tzFileName;
|
strcpy(tzCurrentFileName, tzFileName);
|
||||||
CurrentFlexHandle = yy_create_buffer(pCurrentFile);
|
CurrentFlexHandle = yy_create_buffer(pCurrentFile);
|
||||||
yy_switch_to_buffer(CurrentFlexHandle);
|
yy_switch_to_buffer(CurrentFlexHandle);
|
||||||
nLineNo = 1;
|
nLineNo = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user