2015-07-16 10:36:20 +00:00
|
|
|
#ifndef CSV_WORLD_SCRIPTERRORTABLE_H
|
|
|
|
#define CSV_WORLD_SCRIPTERRORTABLE_H
|
|
|
|
|
|
|
|
#include <QTableWidget>
|
|
|
|
|
2022-10-19 17:02:00 +00:00
|
|
|
#include <string>
|
|
|
|
|
2015-07-16 10:36:20 +00:00
|
|
|
#include <components/compiler/errorhandler.hpp>
|
|
|
|
#include <components/compiler/extensions.hpp>
|
|
|
|
|
|
|
|
#include "../../model/doc/messages.hpp"
|
|
|
|
#include "../../model/world/scriptcontext.hpp"
|
|
|
|
|
2022-10-19 17:02:00 +00:00
|
|
|
namespace Compiler
|
|
|
|
{
|
|
|
|
struct TokenLoc;
|
|
|
|
}
|
|
|
|
|
2015-07-16 10:36:20 +00:00
|
|
|
namespace CSMDoc
|
|
|
|
{
|
|
|
|
class Document;
|
|
|
|
}
|
|
|
|
|
2015-12-12 13:49:16 +00:00
|
|
|
namespace CSMPrefs
|
|
|
|
{
|
|
|
|
class Setting;
|
|
|
|
}
|
|
|
|
|
2015-07-16 10:36:20 +00:00
|
|
|
namespace CSVWorld
|
|
|
|
{
|
|
|
|
class ScriptErrorTable : public QTableWidget, private Compiler::ErrorHandler
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
Compiler::Extensions mExtensions;
|
|
|
|
CSMWorld::ScriptContext mContext;
|
2015-07-16 10:36:20 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void report(const std::string& message, const Compiler::TokenLoc& loc, Type type) override;
|
2015-07-16 10:36:20 +00:00
|
|
|
///< Report error to the user.
|
|
|
|
|
|
|
|
void report(const std::string& message, Type type) override;
|
2015-07-17 11:53:22 +00:00
|
|
|
///< Report a file related error
|
2015-07-16 10:36:20 +00:00
|
|
|
|
2015-12-12 13:49:16 +00:00
|
|
|
void addMessage(const std::string& message, CSMDoc::Message::Severity severity, int line = -1, int column = -1);
|
2015-07-17 09:52:59 +00:00
|
|
|
|
2015-07-16 10:36:20 +00:00
|
|
|
void setWarningsMode(const std::string& value);
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
public:
|
2020-11-13 07:39:47 +00:00
|
|
|
ScriptErrorTable(const CSMDoc::Document& document, QWidget* parent = nullptr);
|
2015-07-16 10:36:20 +00:00
|
|
|
|
|
|
|
void update(const std::string& source);
|
2015-07-17 11:42:25 +00:00
|
|
|
|
2015-07-18 15:00:00 +00:00
|
|
|
void clear();
|
|
|
|
|
2015-09-22 13:36:00 +00:00
|
|
|
/// Clear local variable cache for \a script.
|
|
|
|
///
|
|
|
|
/// \return Were there any locals that needed clearing?
|
|
|
|
bool clearLocals(const std::string& script);
|
|
|
|
|
2015-07-17 11:42:25 +00:00
|
|
|
private slots:
|
|
|
|
|
2015-12-12 13:49:16 +00:00
|
|
|
void settingChanged(const CSMPrefs::Setting* setting);
|
|
|
|
|
2015-07-17 11:42:25 +00:00
|
|
|
void cellClicked(int row, int column);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
2015-07-17 11:53:22 +00:00
|
|
|
void highlightError(int line, int column);
|
2015-07-16 10:36:20 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|