-
Notifications
You must be signed in to change notification settings - Fork 464
/
expand.hpp
98 lines (76 loc) · 2.48 KB
/
expand.hpp
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef SASS_EXPAND_H
#define SASS_EXPAND_H
#include <vector>
#include "ast.hpp"
#include "eval.hpp"
#include "operation.hpp"
#include "environment.hpp"
namespace Sass {
class Listize;
class Context;
class Eval;
struct Backtrace;
class Expand : public Operation_CRTP<Statement*, Expand> {
public:
Env* environment();
SelectorListObj& selector();
SelectorListObj& original();
SelectorListObj popFromSelectorStack();
SelectorStack getOriginalStack();
SelectorStack getSelectorStack();
void pushNullSelector();
void popNullSelector();
void pushToSelectorStack(SelectorListObj selector);
SelectorListObj popFromOriginalStack();
void pushToOriginalStack(SelectorListObj selector);
Context& ctx;
Backtraces& traces;
Eval eval;
size_t recursions;
bool in_keyframes;
bool at_root_without_rule;
bool old_at_root_without_rule;
// it's easier to work with vectors
EnvStack env_stack;
BlockStack block_stack;
CallStack call_stack;
private:
SelectorStack selector_stack;
public:
SelectorStack originalStack;
MediaStack mediaStack;
Boolean_Obj bool_true;
private:
std::vector<CssMediaQuery_Obj> mergeMediaQueries(const std::vector<CssMediaQuery_Obj>& lhs, const std::vector<CssMediaQuery_Obj>& rhs);
public:
Expand(Context&, Env*, SelectorStack* stack = nullptr, SelectorStack* original = nullptr);
~Expand() { }
Block* operator()(Block*);
Statement* operator()(Ruleset*);
Statement* operator()(MediaRule*);
// Css Ruleset is already static
// Statement* operator()(CssMediaRule*);
Statement* operator()(Supports_Block*);
Statement* operator()(At_Root_Block*);
Statement* operator()(Directive*);
Statement* operator()(Declaration*);
Statement* operator()(Assignment*);
Statement* operator()(Import*);
Statement* operator()(Import_Stub*);
Statement* operator()(Warning*);
Statement* operator()(Error*);
Statement* operator()(Debug*);
Statement* operator()(Comment*);
Statement* operator()(If*);
Statement* operator()(For*);
Statement* operator()(Each*);
Statement* operator()(While*);
Statement* operator()(Return*);
Statement* operator()(ExtendRule*);
Statement* operator()(Definition*);
Statement* operator()(Mixin_Call*);
Statement* operator()(Content*);
void append_block(Block*);
};
}
#endif