This repository has been archived by the owner on Mar 13, 2021. It is now read-only.
forked from sass/libsass
-
Notifications
You must be signed in to change notification settings - Fork 1
/
inspect.hpp
96 lines (83 loc) · 2.81 KB
/
inspect.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
#include <string>
#ifndef SASS_OPERATION
#include "operation.hpp"
#endif
// #ifndef SASS_TO_STRING
// #include "to_string.hpp"
// #endif
namespace Sass {
using namespace std;
class Context;
class Inspect : public Operation_CRTP<void, Inspect> {
// import all the class-specific methods and override as desired
using Operation_CRTP<void, Inspect>::operator();
// To_String* to_string;
string buffer;
size_t indentation;
Context* ctx;
void indent();
void fallback_impl(AST_Node* n);
public:
Inspect(Context* ctx = 0);
virtual ~Inspect();
string get_buffer() { return buffer; }
// statements
virtual void operator()(Block*);
virtual void operator()(Ruleset*);
virtual void operator()(Propset*);
virtual void operator()(Media_Block*);
virtual void operator()(At_Rule*);
virtual void operator()(Declaration*);
virtual void operator()(Assignment*);
virtual void operator()(Import*);
virtual void operator()(Import_Stub*);
virtual void operator()(Warning*);
virtual void operator()(Comment*);
virtual void operator()(If*);
virtual void operator()(For*);
virtual void operator()(Each*);
virtual void operator()(While*);
virtual void operator()(Return*);
virtual void operator()(Extension*);
virtual void operator()(Definition*);
virtual void operator()(Mixin_Call*);
virtual void operator()(Content*);
// expressions
virtual void operator()(List*);
virtual void operator()(Binary_Expression*);
virtual void operator()(Unary_Expression*);
virtual void operator()(Function_Call*);
virtual void operator()(Function_Call_Schema*);
virtual void operator()(Variable*);
virtual void operator()(Textual*);
virtual void operator()(Number*);
virtual void operator()(Color*);
virtual void operator()(Boolean*);
virtual void operator()(String_Schema*);
virtual void operator()(String_Constant*);
virtual void operator()(Media_Query*);
virtual void operator()(Media_Query_Expression*);
// virtual void operator()(Null*);
// parameters and arguments
virtual void operator()(Parameter*);
virtual void operator()(Parameters*);
virtual void operator()(Argument*);
virtual void operator()(Arguments*);
// selectors
virtual void operator()(Selector_Schema*);
virtual void operator()(Selector_Reference*);
virtual void operator()(Selector_Placeholder*);
virtual void operator()(Type_Selector*);
virtual void operator()(Selector_Qualifier*);
virtual void operator()(Attribute_Selector*);
virtual void operator()(Pseudo_Selector*);
virtual void operator()(Negated_Selector*);
virtual void operator()(Simple_Selector_Sequence*);
virtual void operator()(Selector_Combination*);
virtual void operator()(Selector_Group*);
template <typename U>
void fallback(U x) { fallback_impl(x); }
};
string unquote(const string&);
string quote(const string&, char);
}