mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Implement __FILE__ symbol
Also clean up built-in symbol creation This is not great, but currently okay. Should be fixed later, like the rest...
This commit is contained in:
@@ -229,8 +229,8 @@ void fstk_RunMacro(char *macroName, struct MacroArgs *args)
|
||||
|
||||
newContext(0);
|
||||
/* Line minus 1 because buffer begins with a newline */
|
||||
contextStack->lexerState = lexer_OpenFileView(macro->macro,
|
||||
macro->macroSize, macro->fileLine - 1);
|
||||
contextStack->lexerState = lexer_OpenFileView(macro->macro, macro->macroSize,
|
||||
macro->fileLine - 1);
|
||||
if (!contextStack->lexerState)
|
||||
fatalerror("Failed to set up lexer for macro invocation\n");
|
||||
lexer_SetStateAtEOL(contextStack->lexerState);
|
||||
@@ -307,6 +307,11 @@ char *fstk_DumpToStr(void)
|
||||
return str;
|
||||
}
|
||||
|
||||
char const *fstk_GetFileName(void)
|
||||
{
|
||||
return contextStack->fileName;
|
||||
}
|
||||
|
||||
uint32_t fstk_GetLine(void)
|
||||
{
|
||||
return lexer_GetLineNo();
|
||||
|
||||
Reference in New Issue
Block a user