Changeset View
Changeset View
Standalone View
Standalone View
src/backends/julia/juliahighlighter.h
Show All 15 Lines | |||||
16 | * | 16 | * | ||
17 | * --- | 17 | * --- | ||
18 | * Copyright (C) 2016 Ivan Lakhtanov <ivan.lakhtanov@gmail.com> | 18 | * Copyright (C) 2016 Ivan Lakhtanov <ivan.lakhtanov@gmail.com> | ||
19 | */ | 19 | */ | ||
20 | #pragma once | 20 | #pragma once | ||
21 | 21 | | |||
22 | #include "defaulthighlighter.h" | 22 | #include "defaulthighlighter.h" | ||
23 | 23 | | |||
24 | /** | ||||
25 | * Implementation of JuliaHighlighter | ||||
26 | * | ||||
27 | * Takes into account loaded symbols from scope and predefined keywords. | ||||
28 | * There is no common regexps that bound to fail with such syntax-overloaded | ||||
29 | * languages as Julia | ||||
30 | */ | ||||
24 | class JuliaHighlighter: public Cantor::DefaultHighlighter | 31 | class JuliaHighlighter: public Cantor::DefaultHighlighter | ||
25 | { | 32 | { | ||
26 | Q_OBJECT | 33 | Q_OBJECT | ||
27 | 34 | | |||
28 | public: | 35 | public: | ||
36 | /** | ||||
37 | * Constructs JuliaHighlighter | ||||
38 | * | ||||
39 | * @param parent QObject parent | ||||
40 | */ | ||||
29 | JuliaHighlighter(QObject *parent); | 41 | JuliaHighlighter(QObject *parent); | ||
30 | virtual ~JuliaHighlighter() {} | 42 | virtual ~JuliaHighlighter() {} | ||
31 | 43 | | |||
32 | public Q_SLOTS: | 44 | public Q_SLOTS: | ||
45 | /** | ||||
46 | * Call this to update highlighter to the current state of keywords storage | ||||
47 | */ | ||||
33 | void updateHighlight(); | 48 | void updateHighlight(); | ||
34 | 49 | | |||
35 | protected: | 50 | protected: | ||
51 | /** | ||||
52 | * @see Cantor::DefaultHighlighter::highlightBlock | ||||
53 | */ | ||||
36 | virtual void highlightBlock(const QString &text) override; | 54 | virtual void highlightBlock(const QString &text) override; | ||
55 | | ||||
56 | /** | ||||
57 | * @see Cantor::DefaultHighlighter::nonSeparatingCharacters | ||||
58 | */ | ||||
37 | virtual QString nonSeparatingCharacters() const override; | 59 | virtual QString nonSeparatingCharacters() const override; | ||
38 | }; | 60 | }; |