1 #ifndef SASS_CSSIZE_H 2 #define SASS_CSSIZE_H 3 4 #include "ast.hpp" 5 #include "context.hpp" 6 #include "operation.hpp" 7 #include "environment.hpp" 8 9 namespace Sass { 10 11 struct Backtrace; 12 13 class Cssize : public Operation_CRTP<Statement*, Cssize> { 14 15 Backtraces& traces; 16 BlockStack block_stack; 17 sass::vector<Statement*> p_stack; 18 19 public: 20 Cssize(Context&); ~Cssize()21 ~Cssize() { } 22 23 Block* operator()(Block*); 24 Statement* operator()(StyleRule*); 25 // Statement* operator()(Bubble*); 26 Statement* operator()(CssMediaRule*); 27 Statement* operator()(SupportsRule*); 28 Statement* operator()(AtRootRule*); 29 Statement* operator()(AtRule*); 30 Statement* operator()(Keyframe_Rule*); 31 Statement* operator()(Trace*); 32 Statement* operator()(Declaration*); 33 // Statement* operator()(Assignment*); 34 // Statement* operator()(Import*); 35 // Statement* operator()(Import_Stub*); 36 // Statement* operator()(WarningRule*); 37 // Statement* operator()(Error*); 38 // Statement* operator()(Comment*); 39 // Statement* operator()(If*); 40 // Statement* operator()(ForRule*); 41 // Statement* operator()(EachRule*); 42 // Statement* operator()(WhileRule*); 43 // Statement* operator()(Return*); 44 // Statement* operator()(ExtendRule*); 45 // Statement* operator()(Definition*); 46 // Statement* operator()(Mixin_Call*); 47 // Statement* operator()(Content*); 48 Statement* operator()(Null*); 49 50 Statement* parent(); 51 sass::vector<std::pair<bool, Block_Obj>> slice_by_bubble(Block*); 52 Statement* bubble(AtRule*); 53 Statement* bubble(AtRootRule*); 54 Statement* bubble(CssMediaRule*); 55 Statement* bubble(SupportsRule*); 56 57 Block* debubble(Block* children, Statement* parent = 0); 58 Block* flatten(const Block*); 59 bool bubblable(Statement*); 60 61 // generic fallback 62 template <typename U> fallback(U x)63 Statement* fallback(U x) 64 { return Cast<Statement>(x); } 65 66 void append_block(Block*, Block*); 67 }; 68 69 } 70 71 #endif 72