Initial commit
[yaffs-website] / node_modules / node-sass / src / libsass / src / extend.hpp
1 #ifndef SASS_EXTEND_H
2 #define SASS_EXTEND_H
3
4 #include <string>
5 #include <set>
6
7 #include "ast.hpp"
8 #include "operation.hpp"
9 #include "subset_map.hpp"
10
11 namespace Sass {
12
13   class Context;
14   class Node;
15
16   class Extend : public Operation_CRTP<void, Extend> {
17
18     Context&            ctx;
19     Subset_Map& subset_map;
20
21     void fallback_impl(AST_Node_Ptr n) { }
22
23   public:
24     static Node subweave(Node& one, Node& two, Context& ctx);
25     static Selector_List_Ptr extendSelectorList(Selector_List_Obj pSelectorList, Context& ctx, Subset_Map& subset_map, bool isReplace, bool& extendedSomething, std::set<Compound_Selector>& seen);
26     static Selector_List_Ptr extendSelectorList(Selector_List_Obj pSelectorList, Context& ctx, Subset_Map& subset_map, bool isReplace, bool& extendedSomething);
27     static Selector_List_Ptr extendSelectorList(Selector_List_Obj pSelectorList, Context& ctx, Subset_Map& subset_map, bool isReplace = false) {
28       bool extendedSomething = false;
29       return extendSelectorList(pSelectorList, ctx, subset_map, isReplace, extendedSomething);
30     }
31     static Selector_List_Ptr extendSelectorList(Selector_List_Obj pSelectorList, Context& ctx, Subset_Map& subset_map, std::set<Compound_Selector>& seen) {
32       bool isReplace = false;
33       bool extendedSomething = false;
34       return extendSelectorList(pSelectorList, ctx, subset_map, isReplace, extendedSomething, seen);
35     }
36     Extend(Context&, Subset_Map&);
37     ~Extend() { }
38
39     void operator()(Block_Ptr);
40     void operator()(Ruleset_Ptr);
41     void operator()(Supports_Block_Ptr);
42     void operator()(Media_Block_Ptr);
43     void operator()(Directive_Ptr);
44
45     template <typename U>
46     void fallback(U x) { return fallback_impl(x); }
47   };
48
49 }
50
51 #endif