diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 0884bed9a..2a2b4a9e7 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -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; diff --git a/source/duke3d/src/gamedef.h b/source/duke3d/src/gamedef.h index f16da9a23..e0f5f1eee 100644 --- a/source/duke3d/src/gamedef.h +++ b/source/duke3d/src/gamedef.h @@ -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