Changeset View
Changeset View
Standalone View
Standalone View
src/backends/R/rhighlighter.h
Show All 29 Lines | 27 | { | |||
---|---|---|---|---|---|
30 | public: | 30 | public: | ||
31 | explicit RHighlighter( QObject* parent); | 31 | explicit RHighlighter( QObject* parent); | ||
32 | ~RHighlighter() override = default; | 32 | ~RHighlighter() override = default; | ||
33 | 33 | | |||
34 | protected: | 34 | protected: | ||
35 | void highlightBlock(const QString &text) override; | 35 | void highlightBlock(const QString &text) override; | ||
36 | 36 | | |||
37 | public Q_SLOTS: | 37 | public Q_SLOTS: | ||
38 | void refreshSyntaxRegExps(); | 38 | void addUserVariable(const QStringList& vars); | ||
39 | void updateHighlighting(); | 39 | void removeUserVariable(const QStringList& vars); | ||
40 | 40 | void addUserFunction(const QStringList& funcs); | |||
41 | Q_SIGNALS: | 41 | void removeUserFunction(const QStringList& funcs); | ||
asemke: let's move the declaration of these functions to Cantor::DefaultHighlighter and make them… | |||||
In this moment, not all highlighter supports this variable model, so I think it's no need sirgienko: In this moment, not all highlighter supports this variable model, so I think it's no need | |||||
42 | void syntaxRegExps(QVector<QRegExp>&,QVector<QRegExp>&); | | |||
43 | 42 | | |||
44 | private: | 43 | private: | ||
45 | inline void formatRule(const QRegExp &p, const QTextCharFormat &fmt, const QString& text,bool shift=false); | 44 | inline void formatRule(const QRegExp &p, const QTextCharFormat &fmt, const QString& text,bool shift=false); | ||
46 | inline void massFormat(const QVector<QRegExp>& rules, const QTextCharFormat &fmt, const QString& text,bool shift=false); | 45 | inline void massFormat(const QVector<QRegExp>& rules, const QTextCharFormat &fmt, const QString& text,bool shift=false); | ||
47 | 46 | | |||
47 | void addUserDefinition(const QStringList& names, QVector<QRegExp>& vector); | ||||
asemke: let's use "Definition" instead of "Stuff". Sounds better. | |||||
48 | void removeUserDefinition(const QStringList& names, QVector<QRegExp>& vector); | ||||
49 | | ||||
48 | static const QStringList operators_list; | 50 | static const QStringList operators_list; | ||
49 | static const QStringList specials_list; | 51 | static const QStringList specials_list; | ||
50 | QVector<QRegExp> operators; | 52 | QVector<QRegExp> operators; | ||
51 | QVector<QRegExp> specials; | 53 | QVector<QRegExp> specials; | ||
52 | QVector<QRegExp> functions; | 54 | QVector<QRegExp> functions; | ||
53 | QVector<QRegExp> variables; | 55 | QVector<QRegExp> variables; | ||
54 | }; | 56 | }; | ||
55 | 57 | | |||
56 | #endif /* _RHIGHLIGHTER_H */ | 58 | #endif /* _RHIGHLIGHTER_H */ |
let's move the declaration of these functions to Cantor::DefaultHighlighter and make them abstract. All deriving classes should provide an implementation for them.