Commit f19bc6da authored by Егор Галкин's avatar Егор Галкин
Browse files

Add new file

parent 2f24a5d5
No related merge requests found
Pipeline #1181 canceled with stages
Showing with 50 additions and 0 deletions
+50 -0
highlighter.h 0 → 100644
#ifndef HIGHLIGHTER_H
#define HIGHLIGHTER_H
#include <QSyntaxHighlighter>
#include <QTextDocument>
#include <QString>
#include <QVector>
#include <QRegExp>
#include <QTextCharFormat>
#include <QDomDocument>
#include <QHash>
class Highlighter : public QSyntaxHighlighter
{
public:
explicit Highlighter(QString, QObject *parent = 0);
bool setExtension(const QString&);
//protected:
void highlightBlock(const QString&) override;
private:
QString xml_filename;
QRegExp current_extension;
struct HighlightingRule
{
QRegExp pattern;
QTextCharFormat format;
};
struct HighlightLanguage
{
QVector <HighlightingRule> highlightingRules;
QRegExp commentStartExpression;
QRegExp commentEndExpression;
QTextCharFormat keywordFormat;
QTextCharFormat classFormat;
QTextCharFormat singleLineCommentFormat;
QTextCharFormat multiLineCommentFormat;
QTextCharFormat quotationFormat;
QTextCharFormat functionFormat;
QTextCharFormat preprocFormat;
};
QHash<QRegExp, HighlightLanguage> languagesContainer;
};
#endif // HIGHLIGHTER_H
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment