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 | class JuliaSession; | ||||
25 | | ||||
24 | /** | 26 | /** | ||
25 | * Implementation of JuliaHighlighter | 27 | * Implementation of JuliaHighlighter | ||
26 | * | 28 | * | ||
27 | * Takes into account loaded symbols from scope and predefined keywords. | 29 | * Takes into account loaded symbols from scope and predefined keywords. | ||
28 | * There is no common regexps that bound to fail with such syntax-overloaded | 30 | * There is no common regexps that bound to fail with such syntax-overloaded | ||
29 | * languages as Julia | 31 | * languages as Julia | ||
30 | */ | 32 | */ | ||
31 | class JuliaHighlighter: public Cantor::DefaultHighlighter | 33 | class JuliaHighlighter: public Cantor::DefaultHighlighter | ||
32 | { | 34 | { | ||
33 | Q_OBJECT | 35 | Q_OBJECT | ||
34 | 36 | | |||
35 | public: | 37 | public: | ||
36 | /** | 38 | /** | ||
37 | * Constructs JuliaHighlighter | 39 | * Constructs JuliaHighlighter | ||
38 | * | 40 | * | ||
39 | * @param parent QObject parent | 41 | * @param parent QObject parent | ||
40 | */ | 42 | */ | ||
41 | explicit JuliaHighlighter(QObject *parent); | 43 | explicit JuliaHighlighter(QObject *parent, JuliaSession* session); | ||
42 | ~JuliaHighlighter() override = default; | 44 | ~JuliaHighlighter() override = default; | ||
43 | 45 | | |||
44 | public Q_SLOTS: | | |||
45 | /** | | |||
46 | * Call this to update highlighter to the current state of keywords storage | | |||
47 | */ | | |||
48 | void updateHighlight(); | | |||
49 | | ||||
50 | protected: | 46 | protected: | ||
51 | /** | 47 | /** | ||
52 | * @see Cantor::DefaultHighlighter::highlightBlock | 48 | * @see Cantor::DefaultHighlighter::highlightBlock | ||
53 | */ | 49 | */ | ||
54 | void highlightBlock(const QString &text) override; | 50 | void highlightBlock(const QString &text) override; | ||
55 | 51 | | |||
56 | /** | 52 | /** | ||
57 | * @see Cantor::DefaultHighlighter::nonSeparatingCharacters | 53 | * @see Cantor::DefaultHighlighter::nonSeparatingCharacters | ||
58 | */ | 54 | */ | ||
59 | QString nonSeparatingCharacters() const override; | 55 | QString nonSeparatingCharacters() const override; | ||
60 | }; | 56 | }; |