-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIfContext.h
56 lines (32 loc) · 1.33 KB
/
IfContext.h
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
48
49
50
51
52
53
54
55
#pragma once
#include <stack>
#include "StringUtils.h"
struct StrCTX;
struct RunningIfInfo {
bool bTrueIsDone = false;
bool bElseIsDone = false;
bool bExpectingEndRemainingLineInfo = false;
int level;
StrSizeT start_replaced_zone = npos<StrSizeT>::value;
StrSizeT start_remaining_zone = npos<StrSizeT>::value;
StrSizeT end_remaining_zone = npos<StrSizeT>::value;
StrSizeT end_replaced_zone = npos<StrSizeT>::value;
};
struct IfCtx {
std::stack<RunningIfInfo> runningIfStack;
bool bIgnoreUntilLevel = false;
int endIgnoreLevel = -1;
int TopLevelCount() const;
bool IsIgnoreUntilLevel() const;
int EndIgnoreLevelCount() const;
bool IsIgnoredScope() const;
void SetIgnoreScopeAboveLevel(int level);
void ClearIgnoreLevel();
void AddIf(StrCTX& ctx, bool bEvaluation, StrSizeT directiveStartPos, StrSizeT directiveEndPos, bool& bOutMustSkip);
void UpdateElseIf(StrCTX& ctx, bool bEvaluation, StrSizeT directiveStartPos, StrSizeT directiveEndPos, bool& bOutMustSkip);
void UpdateElse(StrCTX& ctx, StrSizeT directiveStartPos, StrSizeT directiveEndPos, bool& bOutMustSkip);
void UpdateEndif(StrCTX& ctx, StrSizeT directiveStartPos, StrSizeT directiveEndPos, bool& bOutMustSkip);
void RegisterTopRunningInfoSubLocsIfAny(StrCTX& strCtx);
void UnregisterTopRunningInfoSubLocsIfAny(StrCTX& strCtx);
};
//extern IfCtx g_ifCtx;