aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h
blob: e861cbaded49e4a0493ee37f0571c19a16a84495 (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
/*
    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 Definition;

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

    bool isStay() const;

    int popCount() const;
    Context *context() const;

    void parse(const QStringView &contextInstr);
    void resolve(const Definition &def);

private:
    QString m_defName;
    QString m_contextName;
    Context *m_context = nullptr;
    int m_popCount = 0;
};
}

#endif // KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H