mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
added warning mode to script compiler error handler
This commit is contained in:
parent
1deb0a7cdf
commit
8bcdf54570
2 changed files with 18 additions and 4 deletions
|
@ -5,7 +5,7 @@ namespace Compiler
|
|||
{
|
||||
// constructor
|
||||
|
||||
ErrorHandler::ErrorHandler() : mWarnings (0), mErrors (0) {}
|
||||
ErrorHandler::ErrorHandler() : mWarnings (0), mErrors (0), mWarningsMode (1) {}
|
||||
|
||||
// destructor
|
||||
|
||||
|
@ -36,8 +36,13 @@ namespace Compiler
|
|||
|
||||
void ErrorHandler::warning (const std::string& message, const TokenLoc& loc)
|
||||
{
|
||||
++mWarnings;
|
||||
report (message, loc, WarningMessage);
|
||||
if (mWarningsMode==1)
|
||||
{
|
||||
++mWarnings;
|
||||
report (message, loc, WarningMessage);
|
||||
}
|
||||
else if (mWarningsMode==2)
|
||||
error (message, loc);
|
||||
}
|
||||
|
||||
// Generate an error message.
|
||||
|
@ -62,4 +67,9 @@ namespace Compiler
|
|||
{
|
||||
mErrors = mWarnings = 0;
|
||||
}
|
||||
|
||||
void ErrorHandler::setWarningsMode (int mode)
|
||||
{
|
||||
mWarningsMode = mode;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue