aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h
blob: 29b0e685e24d5f91d0b6d98d2d45872501033412 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
    SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org>

    SPDX-License-Identifier: MIT
*/

#ifndef KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H
#define KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H

#include <QString>

namespace KSyntaxHighlighting
{
class Context;
class DefinitionData;

class ContextSwitch
{
public:
    ContextSwitch() = default;
    ~ContextSwitch() = default;

    bool isStay() const
    {
        return m_isStay;
    }

    int popCount() const
    {
        return m_popCount;
    }

    Context *context() const
    {
        return m_context;
    }

    void resolve(DefinitionData &def, QStringView contextInstr);

private:
    Context *m_context = nullptr;
    int m_popCount = 0;
    bool m_isStay = true;
};
}

#endif // KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H