configured script highlighting with extensions

actorid
Marc Zinnschlag 11 years ago
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…
Cancel
Save