Preserve \@ through INCLUDE

Fixes #1112
This commit is contained in:
Rangi
2022-12-11 11:57:45 -05:00
committed by Eldred Habert
parent 69a573923f
commit 01f1703dfb
5 changed files with 61 additions and 2 deletions

View File

@@ -351,8 +351,10 @@ void fstk_RunInclude(char const *path)
if (!contextStack->lexerState)
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 = macro_UndefUniqueID();
// We're back at top-level, so most things are reset,
// but not the unique ID, since INCLUDE may be inside a
// MACRO or REPT/FOR loop
contextStack->uniqueID = contextStack->parent->uniqueID;
}
// Similar to `fstk_RunInclude`, but not subject to `-MG`, and