-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLuaHighlighter.h
More file actions
39 lines (30 loc) · 836 Bytes
/
LuaHighlighter.h
File metadata and controls
39 lines (30 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef LUAHIGHLIGHTER_H
#define LUAHIGHLIGHTER_H
#include <QSyntaxHighlighter>
#include <QTextCharFormat>
class QTextDocument;
class LuaHighlighter : public QSyntaxHighlighter
{
Q_OBJECT
public:
LuaHighlighter(QTextDocument *parent = 0);
protected:
void highlightBlock(const QString &text) Q_DECL_OVERRIDE;
private:
struct HighlightingRule
{
QRegExp pattern;
QTextCharFormat format;
};
QVector<HighlightingRule> highlightingRules;
QRegExp commentStartExpression;
QRegExp commentEndExpression;
QRegExp quoteStartExpression;
QRegExp quoteEndExpression;
QTextCharFormat keywordFormat;
QTextCharFormat valueFormat;
QTextCharFormat singleLineCommentFormat;
QTextCharFormat quotationFormat;
QTextCharFormat functionFormat;
};
#endif // LUAHIGHLIGHTER_H