Remove CON ERROR_OPENBRACKET and ERROR_CLOSEBRACKET and add ERROR_NOTTOPLEVEL

git-svn-id: https://svn.eduke32.com/eduke32@7193 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-11-18 18:10:32 +00:00
parent af7c8efaf8
commit 076cc306f8
2 changed files with 15 additions and 29 deletions

View file

@ -3035,12 +3035,7 @@ DO_DEFSTATE:
if (EDUKE32_PREDICT_FALSE(g_numBraces > 0))
{
C_ReportError(ERROR_OPENBRACKET);
g_errorCnt++;
}
else if (EDUKE32_PREDICT_FALSE(g_numBraces < 0))
{
C_ReportError(ERROR_CLOSEBRACKET);
C_ReportError(ERROR_NOTTOPLEVEL);
g_errorCnt++;
}
@ -6109,12 +6104,7 @@ repeatcase:
}
if (EDUKE32_PREDICT_FALSE(g_numBraces > 0))
{
C_ReportError(ERROR_OPENBRACKET);
g_errorCnt++;
}
else if (EDUKE32_PREDICT_FALSE(g_numBraces < 0))
{
C_ReportError(ERROR_CLOSEBRACKET);
C_ReportError(ERROR_NOTTOPLEVEL);
g_errorCnt++;
}
// if event has already been declared then put a jump in instead
@ -6159,9 +6149,9 @@ repeatcase:
g_errorCnt++;
g_parsingEventPtr = 0;
}
if (EDUKE32_PREDICT_FALSE(g_numBraces != 0))
if (EDUKE32_PREDICT_FALSE(g_numBraces > 0))
{
C_ReportError(g_numBraces > 0 ? ERROR_OPENBRACKET : ERROR_CLOSEBRACKET);
C_ReportError(ERROR_NOTTOPLEVEL);
g_errorCnt++;
}
g_parsingActorPtr = 0;
@ -6702,8 +6692,8 @@ void C_ReportError(int32_t iError)
}
switch (iError)
{
case ERROR_CLOSEBRACKET:
initprintf("%s:%d: error: found more `}' than `{' before `%s'.\n",g_scriptFileName,g_lineNumber,tempbuf);
case ERROR_NOTTOPLEVEL:
initprintf("%s:%d: error: `%s' not at top level within script.\n",g_scriptFileName,g_lineNumber,tempbuf);
break;
case ERROR_EVENTONLY:
initprintf("%s:%d: error: keyword `%s' only available during events.\n",g_scriptFileName,g_lineNumber,tempbuf);
@ -6741,9 +6731,6 @@ void C_ReportError(int32_t iError)
case ERROR_INVALIDARRAYWRITE:
initprintf("%s:%d: error: arrays can only be written to using `setarray'.\n",g_scriptFileName,g_lineNumber);
break;
case ERROR_OPENBRACKET:
initprintf("%s:%d: error: found more `{' than `}' before `%s'.\n",g_scriptFileName,g_lineNumber,tempbuf);
break;
case ERROR_PARAMUNDEFINED:
initprintf("%s:%d: error: parameter `%s' is undefined.\n",g_scriptFileName,g_lineNumber,tempbuf);
break;

View file

@ -240,26 +240,26 @@ enum SystemString_t {
enum ScriptError_t
{
ERROR_CLOSEBRACKET,
ERROR_ARRAYREADONLY,
ERROR_EVENTONLY,
ERROR_EXCEEDSMAXTILES,
ERROR_EXPECTEDKEYWORD,
ERROR_FOUNDWITHIN,
ERROR_ISAKEYWORD,
ERROR_NOENDSWITCH,
ERROR_NOTAGAMEDEF,
ERROR_NOTAGAMEVAR,
ERROR_NOTAGAMEARRAY,
ERROR_GAMEARRAYBNC,
ERROR_GAMEARRAYBNO,
ERROR_INVALIDARRAYWRITE,
ERROR_OPENBRACKET,
ERROR_PARAMUNDEFINED,
ERROR_ISAKEYWORD,
ERROR_NOENDSWITCH,
ERROR_NOTAGAMEARRAY,
ERROR_NOTAGAMEDEF,
ERROR_NOTAGAMEVAR,
ERROR_NOTAMEMBER,
ERROR_NOTTOPLEVEL,
ERROR_PARAMUNDEFINED,
ERROR_SYNTAXERROR,
ERROR_VARREADONLY,
ERROR_ARRAYREADONLY,
ERROR_VARTYPEMISMATCH,
WARNING_ARRAYMASKSKEYWORD,
WARNING_BADGAMEVAR,
WARNING_DUPLICATECASE,
WARNING_DUPLICATEDEFINITION,
@ -267,7 +267,6 @@ enum ScriptError_t
WARNING_LABELSONLY,
WARNING_NAMEMATCHESVAR,
WARNING_VARMASKSKEYWORD,
WARNING_ARRAYMASKSKEYWORD
};
enum PlayerLabel_t