File indexing completed on 2024-05-12 04:02:17

0001 /*
0002     SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: MIT
0005 */
0006 
0007 #ifndef KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H
0008 #define KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H
0009 
0010 #include <QString>
0011 
0012 namespace KSyntaxHighlighting
0013 {
0014 class Context;
0015 class DefinitionData;
0016 
0017 class ContextSwitch
0018 {
0019 public:
0020     ContextSwitch() = default;
0021     ~ContextSwitch() = default;
0022 
0023     bool isStay() const
0024     {
0025         return m_isStay;
0026     }
0027 
0028     int popCount() const
0029     {
0030         return m_popCount;
0031     }
0032 
0033     Context *context() const
0034     {
0035         return m_context;
0036     }
0037 
0038     void resolve(DefinitionData &def, QStringView contextInstr);
0039 
0040 private:
0041     Context *m_context = nullptr;
0042     int m_popCount = 0;
0043     bool m_isStay = true;
0044 };
0045 }
0046 
0047 #endif // KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H