-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathFabricSpliceKLSyntaxHighlighter.h
More file actions
42 lines (32 loc) · 975 Bytes
/
Copy pathFabricSpliceKLSyntaxHighlighter.h
File metadata and controls
42 lines (32 loc) · 975 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
40
41
42
#ifndef _CREATIONSPLICEKLSYNTAXHIGHLIGTER_H_
#define _CREATIONSPLICEKLSYNTAXHIGHLIGTER_H_
#include <QtCore/QHash>
#include <QtGui/QSyntaxHighlighter>
#include <QtGui/QTextCharFormat>
#include <QtGui/QTextDocument>
#include <FabricCore.h>
class FabricSpliceKLSyntaxHighlighter : public QSyntaxHighlighter {
public:
FabricSpliceKLSyntaxHighlighter(QTextDocument * document);
bool isKeyWord(const QString & word);
protected:
void highlightBlock(const QString &text);
private:
struct HighlightingRule
{
QRegExp pattern;
QTextCharFormat format;
};
QVector<HighlightingRule> highlightingRules;
QRegExp commentStartExpression;
QRegExp commentEndExpression;
QStringList keywordPatterns;
QStringList classPatterns;
QTextCharFormat keywordFormat;
QTextCharFormat classFormat;
QTextCharFormat singleLineCommentFormat;
QTextCharFormat multiLineCommentFormat;
QTextCharFormat quotationFormat;
QTextCharFormat functionFormat;
};
#endif