mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-30 13:20:52 +00:00
remove "DECORATE" from error string
* print warning count as well * allow treating warnings as errors
This commit is contained in:
parent
325817afdf
commit
e82c7d2428
2 changed files with 22 additions and 1 deletions
|
@ -40,6 +40,7 @@
|
||||||
#include "filesystem.h"
|
#include "filesystem.h"
|
||||||
|
|
||||||
CVAR(Bool, strictdecorate, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
|
CVAR(Bool, strictdecorate, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
|
||||||
|
CVAR(Bool, warningstoerrors, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
|
||||||
|
|
||||||
EXTERN_CVAR(Bool, vm_jit)
|
EXTERN_CVAR(Bool, vm_jit)
|
||||||
EXTERN_CVAR(Bool, vm_jit_aot)
|
EXTERN_CVAR(Bool, vm_jit_aot)
|
||||||
|
|
|
@ -65,6 +65,7 @@ static TMap<FState *, FScriptPosition> StateSourceLines;
|
||||||
static FScriptPosition unknownstatesource("unknown file", 0);
|
static FScriptPosition unknownstatesource("unknown file", 0);
|
||||||
|
|
||||||
EXTERN_CVAR(Bool, strictdecorate);
|
EXTERN_CVAR(Bool, strictdecorate);
|
||||||
|
EXTERN_CVAR(Bool, warningstoerrors);
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
|
@ -464,8 +465,27 @@ void LoadActors()
|
||||||
|
|
||||||
if (FScriptPosition::ErrorCounter > 0)
|
if (FScriptPosition::ErrorCounter > 0)
|
||||||
{
|
{
|
||||||
I_Error("%d errors while parsing DECORATE scripts", FScriptPosition::ErrorCounter);
|
if (FScriptPosition::WarnCounter > 0)
|
||||||
|
{
|
||||||
|
I_Error("%d errors, %d warnings while parsing scripts", FScriptPosition::ErrorCounter, FScriptPosition::WarnCounter);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
I_Error("%d errors while parsing scripts", FScriptPosition::ErrorCounter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else if (FScriptPosition::WarnCounter > 0)
|
||||||
|
{
|
||||||
|
if(warningstoerrors)
|
||||||
|
{
|
||||||
|
I_Error("%d warnings while parsing scripts\n", FScriptPosition::WarnCounter);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Printf(TEXTCOLOR_ORANGE "%d warnings while parsing scripts\n", FScriptPosition::WarnCounter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FScriptPosition::ResetErrorCounter();
|
FScriptPosition::ResetErrorCounter();
|
||||||
// AllActorClasses hasn'T been set up yet.
|
// AllActorClasses hasn'T been set up yet.
|
||||||
for (int i = PClass::AllClasses.Size() - 1; i >= 0; i--)
|
for (int i = PClass::AllClasses.Size() - 1; i >= 0; i--)
|
||||||
|
|
Loading…
Reference in a new issue