Changeset View
Changeset View
Standalone View
Standalone View
src/backends/python/pythonhighlighter.h
Show All 26 Lines | |||||
27 | { | 27 | { | ||
28 | Q_OBJECT | 28 | Q_OBJECT | ||
29 | 29 | | |||
30 | public: | 30 | public: | ||
31 | explicit PythonHighlighter(QObject* parent, const int pythonVersion); | 31 | explicit PythonHighlighter(QObject* parent, const int pythonVersion); | ||
32 | ~PythonHighlighter() override = default; | 32 | ~PythonHighlighter() override = default; | ||
33 | 33 | | |||
34 | public Q_SLOTS: | 34 | public Q_SLOTS: | ||
35 | void updateHighlight(); | 35 | void addUserVariable(const QStringList& variables); | ||
36 | void addVariable(const QString variable); | 36 | void removeUserVariable(const QStringList& variables); | ||
37 | void clearVariables(); | | |||
38 | 37 | | |||
39 | protected: | 38 | protected: | ||
40 | void highlightBlock(const QString& text) override; | 39 | void highlightBlock(const QString& text) override; | ||
41 | 40 | | |||
42 | private: | 41 | private: | ||
43 | QRegExp commentStartExpression; | 42 | QRegExp commentStartExpression; | ||
44 | QRegExp commentEndExpression; | 43 | QRegExp commentEndExpression; | ||
45 | QStringList m_variables; | | |||
46 | | ||||
47 | }; | 44 | }; | ||
48 | 45 | | |||
49 | #endif /* _PYTHONHIGHLIGHTER_H */ | 46 | #endif /* _PYTHONHIGHLIGHTER_H */ |