Handle MACRO and REPT/FOR bodies differently

Fixes #697
This commit is contained in:
Rangi
2021-01-12 21:30:13 -05:00
committed by Eldred Habert
parent a4ebb87858
commit df16e64fc6
9 changed files with 108 additions and 94 deletions

View File

@@ -413,9 +413,8 @@ void fstk_RunMacro(char const *macroName, struct MacroArgs *args)
memcpy(dest, macro->name, macroNameLen + 1);
newContext((struct FileStackNode *)fileInfo);
/* Line minus 1 because buffer begins with a newline */
contextStack->lexerState = lexer_OpenFileView(macro->macro, macro->macroSize,
macro->fileLine - 1);
macro->fileLine);
if (!contextStack->lexerState)
fatalerror("Failed to set up lexer for macro invocation\n");
lexer_SetStateAtEOL(contextStack->lexerState);