blob: d138c58c50dbb681465a3ffbc277ed4a5227132c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once
#include <texteditor/syntaxhighlighter.h>
namespace Python {
namespace Internal {
class Scanner;
class PythonHighlighter : public TextEditor::SyntaxHighlighter
{
public:
PythonHighlighter();
private:
void highlightBlock(const QString &text) override;
int highlightLine(const QString &text, int initialState);
void highlightImport(Internal::Scanner &scanner);
int m_lastIndent = 0;
bool withinLicenseHeader = false;
};
} // namespace Internal
} // namespace Python
|