#ifndef SYNTAXHIGHLIGHTER_H #define SYNTAXHIGHLIGHTER_H #include class SyntaxHighlighter : public QSyntaxHighlighter { Q_OBJECT public: SyntaxHighlighter(QTextDocument *parent = 0); protected: void highlightBlock(const QString &text) override; private: /*struct HighlightingRule { QRegularExpression pattern; QTextCharFormat format; }; QVector highlightingRules; QRegularExpression commentStartExpression; QRegularExpression commentEndExpression;*/ /** * @brief color per loop level */ std::vector levelColor; QTextCharFormat comment; QTextCharFormat error; bool isBfChar(const QChar& c); }; #endif // SYNTAXHIGHLIGHTER_H