1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 12:42:11 +00:00
OpenMW/apps/opencs/model/tools/scriptcheck.hpp
fteppe 20da0892ef openMW_test_suite compiles and runs
Slowly moving through the open-cs errors

Good progress in openCS

Very good progress on openCS

Getting closer with openCS

OpenCS compiles and runs! Didn't have time to test it all though

ix openMW

everything compiles on windows??

Fix gcc

Fix Clang
2022-12-27 19:15:55 +01:00

66 lines
1.5 KiB
C++

#ifndef CSM_TOOLS_SCRIPTCHECK_H
#define CSM_TOOLS_SCRIPTCHECK_H
#include <string>
#include <components/compiler/errorhandler.hpp>
#include <components/compiler/extensions.hpp>
#include <apps/opencs/model/doc/messages.hpp>
#include "../doc/stage.hpp"
#include "../world/scriptcontext.hpp"
namespace CSMDoc
{
class Document;
}
namespace Compiler
{
struct TokenLoc;
}
namespace CSMTools
{
/// \brief VerifyStage: make sure that scripts compile
class ScriptCheckStage : public CSMDoc::Stage, private Compiler::ErrorHandler
{
enum WarningMode
{
Mode_Ignore,
Mode_Normal,
Mode_Strict
};
const CSMDoc::Document& mDocument;
Compiler::Extensions mExtensions;
CSMWorld::ScriptContext mContext;
ESM::RefId mId;
std::string mFile;
CSMDoc::Messages* mMessages;
WarningMode mWarningMode;
bool mIgnoreBaseRecords;
CSMDoc::Message::Severity getSeverity(Type type);
void report(const std::string& message, const Compiler::TokenLoc& loc, Type type) override;
///< Report error to the user.
void report(const std::string& message, Type type) override;
///< Report a file related error
public:
ScriptCheckStage(const CSMDoc::Document& document);
int setup() override;
///< \return number of steps
void perform(int stage, CSMDoc::Messages& messages) override;
///< Messages resulting from this tage will be appended to \a messages.
};
}
#endif