1/*
2 SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#ifndef KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H
8#define KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H
9
10#include <QString>
11
12namespace KSyntaxHighlighting
13{
14class Context;
15class DefinitionData;
16
17class ContextSwitch
18{
19public:
20 ContextSwitch() = default;
21 ~ContextSwitch() = default;
22
23 bool isStay() const
24 {
25 return m_isStay;
26 }
27
28 int popCount() const
29 {
30 return m_popCount;
31 }
32
33 Context *context() const
34 {
35 return m_context;
36 }
37
38 void resolve(DefinitionData &def, QStringView contextInstr);
39
40private:
41 Context *m_context = nullptr;
42 int m_popCount = 0;
43 bool m_isStay = true;
44};
45}
46
47#endif // KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H
48

source code of syntax-highlighting/src/lib/contextswitch_p.h