mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
configured script highlighting with extensions
This commit is contained in:
parent
d5ef843f56
commit
78f7f80fc3
@ -4,6 +4,7 @@
|
||||
#include <sstream>
|
||||
|
||||
#include <components/compiler/scanner.hpp>
|
||||
#include <components/compiler/extensions0.hpp>
|
||||
|
||||
bool CSVWorld::ScriptHighlighter::parseInt (int value, const Compiler::TokenLoc& loc,
|
||||
Compiler::Scanner& scanner)
|
||||
@ -101,6 +102,10 @@ CSVWorld::ScriptHighlighter::ScriptHighlighter (QTextDocument *parent)
|
||||
format.setForeground (Qt::green);
|
||||
mScheme.insert (std::make_pair (Type_Comment, format));
|
||||
}
|
||||
|
||||
// configure compiler
|
||||
Compiler::registerExtensions (mExtensions);
|
||||
mContext.setExtensions (&mExtensions);
|
||||
}
|
||||
|
||||
void CSVWorld::ScriptHighlighter::highlightBlock (const QString& text)
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <components/compiler/nullerrorhandler.hpp>
|
||||
#include <components/compiler/parser.hpp>
|
||||
#include <components/compiler/extensions.hpp>
|
||||
|
||||
#include "../../model/world/scriptcontext.hpp"
|
||||
|
||||
@ -29,6 +30,7 @@ namespace CSVWorld
|
||||
private:
|
||||
|
||||
Compiler::NullErrorHandler mErrorHandler;
|
||||
Compiler::Extensions mExtensions;
|
||||
CSMWorld::ScriptContext mContext;
|
||||
std::map<Type, QTextCharFormat> mScheme;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user