- fixed: Lemon includes ParseTrace only in debug builds so the option to use it must be #ifdef'd.

This commit is contained in:
Christoph Oelckers 2016-11-27 17:43:11 +01:00
parent cc7120d5b6
commit aab304c0cf

View file

@ -303,6 +303,7 @@ static void DoParse(int lumpnum)
parser = ZCCParseAlloc(malloc); parser = ZCCParseAlloc(malloc);
ZCCParseState state; ZCCParseState state;
#ifndef NDEBUG
FILE *f = nullptr; FILE *f = nullptr;
const char *tracefile = Args->CheckValue("-tracefile"); const char *tracefile = Args->CheckValue("-tracefile");
if (tracefile != nullptr) if (tracefile != nullptr)
@ -311,6 +312,7 @@ static void DoParse(int lumpnum)
char prompt = '\0'; char prompt = '\0';
ZCCParseTrace(f, &prompt); ZCCParseTrace(f, &prompt);
} }
#endif
sc.OpenLumpNum(lumpnum); sc.OpenLumpNum(lumpnum);
auto saved = sc.SavePos(); auto saved = sc.SavePos();
@ -360,10 +362,12 @@ static void DoParse(int lumpnum)
I_Error("%d errors while parsing %s", FScriptPosition::ErrorCounter, Wads.GetLumpFullPath(lumpnum).GetChars()); I_Error("%d errors while parsing %s", FScriptPosition::ErrorCounter, Wads.GetLumpFullPath(lumpnum).GetChars());
} }
#ifndef NDEBUG
if (f != nullptr) if (f != nullptr)
{ {
fclose(f); fclose(f);
} }
#endif
// Make a dump of the AST before running the compiler for diagnostic purposes. // Make a dump of the AST before running the compiler for diagnostic purposes.
if (Args->CheckParm("-dumpast")) if (Args->CheckParm("-dumpast"))