|
|
|
@ -23,7 +23,7 @@ bool CSVWorld::ScriptHighlighter::parseFloat (float value, const Compiler::Token
|
|
|
|
|
bool CSVWorld::ScriptHighlighter::parseName (const std::string& name, const Compiler::TokenLoc& loc,
|
|
|
|
|
Compiler::Scanner& scanner)
|
|
|
|
|
{
|
|
|
|
|
highlight (loc, Type_Name);
|
|
|
|
|
highlight (loc, mContext.isId (name) ? Type_Id : Type_Name);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -63,10 +63,10 @@ void CSVWorld::ScriptHighlighter::highlight (const Compiler::TokenLoc& loc, Type
|
|
|
|
|
setFormat (index, length, mScheme[type]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSVWorld::ScriptHighlighter::ScriptHighlighter (QTextDocument *parent)
|
|
|
|
|
: QSyntaxHighlighter (parent), Compiler::Parser (mErrorHandler, mContext)
|
|
|
|
|
CSVWorld::ScriptHighlighter::ScriptHighlighter (const CSMWorld::Data& data, QTextDocument *parent)
|
|
|
|
|
: QSyntaxHighlighter (parent), Compiler::Parser (mErrorHandler, mContext), mContext (data)
|
|
|
|
|
{
|
|
|
|
|
/// \ŧodo replace this with user settings
|
|
|
|
|
/// \todo replace this with user settings
|
|
|
|
|
{
|
|
|
|
|
QTextCharFormat format;
|
|
|
|
|
format.setForeground (Qt::darkMagenta);
|
|
|
|
@ -103,6 +103,12 @@ CSVWorld::ScriptHighlighter::ScriptHighlighter (QTextDocument *parent)
|
|
|
|
|
mScheme.insert (std::make_pair (Type_Comment, format));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
QTextCharFormat format;
|
|
|
|
|
format.setForeground (Qt::blue);
|
|
|
|
|
mScheme.insert (std::make_pair (Type_Id, format));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// configure compiler
|
|
|
|
|
Compiler::registerExtensions (mExtensions);
|
|
|
|
|
mContext.setExtensions (&mExtensions);
|
|
|
|
|