File indexing completed on 2024-05-26 11:22:04

0001 /*
0002     SPDX-License-Identifier: GPL-2.0-or-later
0003     SPDX-FileCopyrightText: 2016 Ivan Lakhtanov <ivan.lakhtanov@gmail.com>
0004 */
0005 #pragma once
0006 
0007 #include "defaulthighlighter.h"
0008 
0009 class JuliaSession;
0010 
0011 /**
0012  * Implementation of JuliaHighlighter
0013  *
0014  * Takes into account loaded symbols from scope and predefined keywords.
0015  * There is no common regexps that bound to fail with such syntax-overloaded
0016  * languages as Julia
0017  */
0018 class JuliaHighlighter: public Cantor::DefaultHighlighter
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     /**
0024      * Constructs JuliaHighlighter
0025      *
0026      * @param parent QObject parent
0027      */
0028     explicit JuliaHighlighter(QObject *parent, JuliaSession* session);
0029     ~JuliaHighlighter() override = default;
0030 
0031 protected:
0032     /**
0033      * @see Cantor::DefaultHighlighter::highlightBlock
0034      */
0035     void highlightBlock(const QString &text) override;
0036 
0037     /**
0038      * @see Cantor::DefaultHighlighter::nonSeparatingCharacters
0039      */
0040     QString nonSeparatingCharacters() const override;
0041 };