Fix captures beginning in expansions

Fixes #590
This commit is contained in:
ISSOtm
2020-12-09 09:54:55 +01:00
parent c3ccdc548e
commit f16e34b804
4 changed files with 5 additions and 3 deletions

View File

@@ -1962,13 +1962,11 @@ restart:
static char *startCapture(void) static char *startCapture(void)
{ {
assert(!lexerState->expansions);
lexerState->capturing = true; lexerState->capturing = true;
lexerState->captureSize = 0; lexerState->captureSize = 0;
lexerState->disableMacroArgs = true; lexerState->disableMacroArgs = true;
if (lexerState->isMmapped) { if (lexerState->isMmapped && !lexerState->expansions) {
return &lexerState->ptr[lexerState->offset]; return &lexerState->ptr[lexerState->offset];
} else { } else {
lexerState->captureCapacity = 128; /* The initial size will be twice that */ lexerState->captureCapacity = 128; /* The initial size will be twice that */

View File

@@ -0,0 +1,3 @@
DEFINE equs "mac: MACRO\nPRINTT \"Hello :D\\n\"\nENDM"
DEFINE
mac

View File

View File

@@ -0,0 +1 @@
Hello :D