#ifndef HIGHLIGHTER_SHOCK_H #define HIGHLIGHTER_SHOCK_H #include #include class Highlighter_Shock : public QSyntaxHighlighter { Q_OBJECT public: Highlighter_Shock(QTextDocument *parent = nullptr); protected: void highlightBlock(const QString &text) override; private: struct HighlightingRule { QRegularExpression pattern; QTextCharFormat format; }; QVector highlightingRules; QTextCharFormat keyFormat; QTextCharFormat stringFormat; QTextCharFormat numberFormat; QTextCharFormat subgroupFormat; }; #endif // HIGHLIGHTER_SHOCK_H