-
Notifications
You must be signed in to change notification settings - Fork 464
/
expand.hpp
76 lines (60 loc) · 1.72 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
#define SASS_EXPAND
#include <vector>
#include <map>
#include <iostream>
#ifndef SASS_AST
#include "ast.hpp"
#endif
#ifndef SASS_OPERATION
#include "operation.hpp"
#endif
#ifndef SASS_ENVIRONMENT
#include "environment.hpp"
#endif
namespace Sass {
using namespace std;
struct Context;
class Eval;
class Contextualize;
typedef Environment<AST_Node*> Env;
struct Backtrace;
class Expand : public Operation_CRTP<Statement*, Expand> {
Context& ctx;
Eval* eval;
Contextualize* contextualize;
Env* env;
vector<Block*> block_stack;
vector<String*> property_stack;
vector<Selector*> selector_stack;
Backtrace* backtrace;
Statement* fallback_impl(AST_Node* n);
public:
Expand(Context&, Eval*, Contextualize*, Env*, Backtrace*);
virtual ~Expand() { }
using Operation<Statement*>::operator();
Statement* operator()(Block*);
Statement* operator()(Ruleset*);
Statement* operator()(Propset*);
Statement* operator()(Media_Block*);
Statement* operator()(At_Rule*);
Statement* operator()(Declaration*);
Statement* operator()(Assignment*);
Statement* operator()(Import*);
Statement* operator()(Import_Stub*);
Statement* operator()(Warning*);
Statement* operator()(Comment*);
Statement* operator()(If*);
Statement* operator()(For*);
Statement* operator()(Each*);
Statement* operator()(While*);
Statement* operator()(Return*);
Statement* operator()(Extension*);
Statement* operator()(Definition*);
Statement* operator()(Mixin_Call*);
Statement* operator()(Content*);
template <typename U>
Statement* fallback(U x) { return fallback_impl(x); }
void append_block(Block*);
multimap<Compound_Selector, Complex_Selector*> extensions;
};
}