Apply clang-format to code base

This commit is contained in:
clang-format-bot 2022-09-22 21:26:05 +03:00 committed by ζeh Matt
parent f37d0be806
commit ddb0522bbf
No known key found for this signature in database
GPG key ID: 18CE582C71A225B0
2199 changed files with 118692 additions and 114392 deletions

View file

@ -10,8 +10,7 @@ namespace Compiler
{
// Report error to the user.
void StreamErrorHandler::report (const std::string& message, const TokenLoc& loc,
Type type)
void StreamErrorHandler::report(const std::string& message, const TokenLoc& loc, Type type)
{
Debug::Level logLevel = Debug::Info; // Usually script warnings are not too important
if (type == ErrorMessage)
@ -19,7 +18,7 @@ namespace Compiler
std::stringstream text;
if (type==ErrorMessage)
if (type == ErrorMessage)
text << "Error: ";
else
text << "Warning: ";
@ -27,23 +26,22 @@ namespace Compiler
if (!mContext.empty())
text << mContext << " ";
text << "line " << loc.mLine+1 << ", column " << loc.mColumn+1
<< " (" << loc.mLiteral << "): " << message;
text << "line " << loc.mLine + 1 << ", column " << loc.mColumn + 1 << " (" << loc.mLiteral << "): " << message;
Log(logLevel) << text.str();
}
// Report a file related error
void StreamErrorHandler::report (const std::string& message, Type type)
void StreamErrorHandler::report(const std::string& message, Type type)
{
Debug::Level logLevel = Debug::Info;
if (type==ErrorMessage)
if (type == ErrorMessage)
logLevel = Debug::Error;
std::stringstream text;
if (type==ErrorMessage)
if (type == ErrorMessage)
text << "Error: ";
else
text << "Warning: ";
@ -56,14 +54,16 @@ namespace Compiler
Log(logLevel) << text.str();
}
void StreamErrorHandler::setContext(const std::string &context)
void StreamErrorHandler::setContext(const std::string& context)
{
mContext = context;
}
StreamErrorHandler::StreamErrorHandler() = default;
ContextOverride::ContextOverride(StreamErrorHandler& handler, const std::string& context) : mHandler(handler), mContext(handler.mContext)
ContextOverride::ContextOverride(StreamErrorHandler& handler, const std::string& context)
: mHandler(handler)
, mContext(handler.mContext)
{
mHandler.setContext(context);
}