sassc 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGELOG.md +5 -0
  4. data/ext/libsass/VERSION +1 -1
  5. data/ext/libsass/include/sass/context.h +3 -0
  6. data/ext/libsass/src/MurmurHash2.hpp +91 -0
  7. data/ext/libsass/src/ast.cpp +117 -117
  8. data/ext/libsass/src/ast.hpp +160 -162
  9. data/ext/libsass/src/ast_def_macros.hpp +10 -10
  10. data/ext/libsass/src/ast_fwd_decl.cpp +2 -2
  11. data/ext/libsass/src/ast_fwd_decl.hpp +61 -52
  12. data/ext/libsass/src/ast_helpers.hpp +5 -5
  13. data/ext/libsass/src/ast_sel_cmp.cpp +18 -18
  14. data/ext/libsass/src/ast_sel_super.cpp +52 -52
  15. data/ext/libsass/src/ast_sel_unify.cpp +16 -16
  16. data/ext/libsass/src/ast_sel_weave.cpp +62 -62
  17. data/ext/libsass/src/ast_selectors.cpp +87 -77
  18. data/ext/libsass/src/ast_selectors.hpp +72 -62
  19. data/ext/libsass/src/ast_supports.cpp +35 -35
  20. data/ext/libsass/src/ast_supports.hpp +29 -29
  21. data/ext/libsass/src/ast_values.cpp +58 -58
  22. data/ext/libsass/src/ast_values.hpp +75 -75
  23. data/ext/libsass/src/backtrace.cpp +9 -9
  24. data/ext/libsass/src/backtrace.hpp +5 -5
  25. data/ext/libsass/src/base64vlq.cpp +2 -2
  26. data/ext/libsass/src/base64vlq.hpp +1 -1
  27. data/ext/libsass/src/bind.cpp +17 -17
  28. data/ext/libsass/src/bind.hpp +1 -1
  29. data/ext/libsass/src/c2ast.cpp +3 -3
  30. data/ext/libsass/src/c2ast.hpp +1 -1
  31. data/ext/libsass/src/check_nesting.cpp +36 -36
  32. data/ext/libsass/src/check_nesting.hpp +2 -2
  33. data/ext/libsass/src/color_maps.cpp +5 -5
  34. data/ext/libsass/src/color_maps.hpp +1 -1
  35. data/ext/libsass/src/context.cpp +63 -60
  36. data/ext/libsass/src/context.hpp +33 -33
  37. data/ext/libsass/src/cssize.cpp +30 -29
  38. data/ext/libsass/src/cssize.hpp +13 -13
  39. data/ext/libsass/src/dart_helpers.hpp +5 -5
  40. data/ext/libsass/src/debugger.hpp +127 -128
  41. data/ext/libsass/src/emitter.cpp +12 -12
  42. data/ext/libsass/src/emitter.hpp +10 -10
  43. data/ext/libsass/src/environment.cpp +27 -27
  44. data/ext/libsass/src/environment.hpp +24 -24
  45. data/ext/libsass/src/error_handling.cpp +42 -42
  46. data/ext/libsass/src/error_handling.hpp +38 -50
  47. data/ext/libsass/src/eval.cpp +138 -132
  48. data/ext/libsass/src/eval.hpp +17 -17
  49. data/ext/libsass/src/eval_selectors.cpp +3 -3
  50. data/ext/libsass/src/expand.cpp +70 -64
  51. data/ext/libsass/src/expand.hpp +12 -12
  52. data/ext/libsass/src/extender.cpp +55 -53
  53. data/ext/libsass/src/extender.hpp +14 -14
  54. data/ext/libsass/src/file.cpp +66 -58
  55. data/ext/libsass/src/file.hpp +23 -25
  56. data/ext/libsass/src/fn_colors.cpp +9 -9
  57. data/ext/libsass/src/fn_lists.cpp +18 -18
  58. data/ext/libsass/src/fn_maps.cpp +3 -3
  59. data/ext/libsass/src/fn_miscs.cpp +15 -15
  60. data/ext/libsass/src/fn_numbers.cpp +7 -7
  61. data/ext/libsass/src/fn_selectors.cpp +8 -8
  62. data/ext/libsass/src/fn_strings.cpp +34 -22
  63. data/ext/libsass/src/fn_utils.cpp +29 -26
  64. data/ext/libsass/src/fn_utils.hpp +10 -10
  65. data/ext/libsass/src/inspect.cpp +35 -34
  66. data/ext/libsass/src/inspect.hpp +21 -21
  67. data/ext/libsass/src/lexer.cpp +3 -1
  68. data/ext/libsass/src/listize.cpp +2 -2
  69. data/ext/libsass/src/mapping.hpp +1 -0
  70. data/ext/libsass/src/memory.hpp +12 -0
  71. data/ext/libsass/src/memory/allocator.cpp +48 -0
  72. data/ext/libsass/src/memory/allocator.hpp +138 -0
  73. data/ext/libsass/src/memory/config.hpp +20 -0
  74. data/ext/libsass/src/memory/memory_pool.hpp +186 -0
  75. data/ext/libsass/src/memory/{SharedPtr.cpp → shared_ptr.cpp} +2 -2
  76. data/ext/libsass/src/memory/{SharedPtr.hpp → shared_ptr.hpp} +18 -6
  77. data/ext/libsass/src/operation.hpp +44 -44
  78. data/ext/libsass/src/operators.cpp +18 -18
  79. data/ext/libsass/src/operators.hpp +11 -11
  80. data/ext/libsass/src/ordered_map.hpp +18 -18
  81. data/ext/libsass/src/output.cpp +16 -16
  82. data/ext/libsass/src/output.hpp +5 -5
  83. data/ext/libsass/src/parser.cpp +327 -345
  84. data/ext/libsass/src/parser.hpp +77 -87
  85. data/ext/libsass/src/parser_selectors.cpp +6 -6
  86. data/ext/libsass/src/permutate.hpp +39 -15
  87. data/ext/libsass/src/plugins.cpp +7 -7
  88. data/ext/libsass/src/plugins.hpp +8 -8
  89. data/ext/libsass/src/position.cpp +7 -26
  90. data/ext/libsass/src/position.hpp +44 -21
  91. data/ext/libsass/src/remove_placeholders.cpp +4 -4
  92. data/ext/libsass/src/remove_placeholders.hpp +3 -3
  93. data/ext/libsass/src/sass.cpp +16 -15
  94. data/ext/libsass/src/sass.hpp +9 -5
  95. data/ext/libsass/src/sass_context.cpp +52 -34
  96. data/ext/libsass/src/sass_values.cpp +8 -10
  97. data/ext/libsass/src/settings.hpp +19 -0
  98. data/ext/libsass/src/source.cpp +69 -0
  99. data/ext/libsass/src/source.hpp +95 -0
  100. data/ext/libsass/src/source_data.hpp +32 -0
  101. data/ext/libsass/src/source_map.cpp +22 -18
  102. data/ext/libsass/src/source_map.hpp +12 -9
  103. data/ext/libsass/src/units.cpp +19 -19
  104. data/ext/libsass/src/units.hpp +8 -8
  105. data/ext/libsass/src/utf8_string.cpp +9 -10
  106. data/ext/libsass/src/utf8_string.hpp +7 -6
  107. data/ext/libsass/src/util.cpp +38 -38
  108. data/ext/libsass/src/util.hpp +18 -18
  109. data/ext/libsass/src/util_string.cpp +13 -13
  110. data/ext/libsass/src/util_string.hpp +9 -8
  111. data/ext/libsass/src/values.cpp +12 -12
  112. data/lib/sassc/native.rb +3 -5
  113. data/lib/sassc/version.rb +1 -1
  114. data/test/native_test.rb +4 -4
  115. metadata +14 -5
  116. data/lib/sassc/native/lib_c.rb +0 -21
@@ -14,7 +14,7 @@ namespace Sass {
14
14
  Cssize::Cssize(Context& ctx)
15
15
  : traces(ctx.traces),
16
16
  block_stack(BlockStack()),
17
- p_stack(std::vector<Statement*>())
17
+ p_stack(sass::vector<Statement*>())
18
18
  { }
19
19
 
20
20
  Statement* Cssize::parent()
@@ -80,17 +80,17 @@ namespace Sass {
80
80
  return 0;
81
81
  }
82
82
 
83
- Statement* Cssize::operator()(Directive* r)
83
+ Statement* Cssize::operator()(AtRule* r)
84
84
  {
85
85
  if (!r->block() || !r->block()->length()) return r;
86
86
 
87
87
  if (parent()->statement_type() == Statement::RULESET)
88
88
  {
89
- return (r->is_keyframes()) ? SASS_MEMORY_NEW(Bubble, r->pstate(), r) : bubble(r);
89
+ return r->is_keyframes() ? SASS_MEMORY_NEW(Bubble, r->pstate(), r) : bubble(r);
90
90
  }
91
91
 
92
92
  p_stack.push_back(r);
93
- Directive_Obj rr = SASS_MEMORY_NEW(Directive,
93
+ AtRuleObj rr = SASS_MEMORY_NEW(AtRule,
94
94
  r->pstate(),
95
95
  r->keyword(),
96
96
  r->selector(),
@@ -107,7 +107,7 @@ namespace Sass {
107
107
  Bubble_Obj s_obj = Cast<Bubble>(s);
108
108
  s = s_obj->node();
109
109
  if (s->statement_type() != Statement::DIRECTIVE) directive_exists = false;
110
- else directive_exists = (Cast<Directive>(s)->keyword() == rr->keyword());
110
+ else directive_exists = (Cast<AtRule>(s)->keyword() == rr->keyword());
111
111
  }
112
112
 
113
113
  }
@@ -115,7 +115,7 @@ namespace Sass {
115
115
  Block* result = SASS_MEMORY_NEW(Block, rr->pstate());
116
116
  if (!(directive_exists || rr->is_keyframes()))
117
117
  {
118
- Directive* empty_node = Cast<Directive>(rr);
118
+ AtRule* empty_node = Cast<AtRule>(rr);
119
119
  empty_node->block(SASS_MEMORY_NEW(Block, rr->block() ? rr->block()->pstate() : rr->pstate()));
120
120
  result->append(empty_node);
121
121
  }
@@ -142,7 +142,7 @@ namespace Sass {
142
142
  return debubble(rr->block(), rr);
143
143
  }
144
144
 
145
- Statement* Cssize::operator()(Ruleset* r)
145
+ Statement* Cssize::operator()(StyleRule* r)
146
146
  {
147
147
  p_stack.push_back(r);
148
148
  // this can return a string schema
@@ -155,7 +155,7 @@ namespace Sass {
155
155
  if (Cast<Statement>(bb) == NULL) {
156
156
  error("Illegal nesting: Only properties may be nested beneath properties.", r->block()->pstate(), traces);
157
157
  }
158
- Ruleset_Obj rr = SASS_MEMORY_NEW(Ruleset,
158
+ StyleRuleObj rr = SASS_MEMORY_NEW(StyleRule,
159
159
  r->pstate(),
160
160
  r->selector(),
161
161
  bb);
@@ -238,7 +238,7 @@ namespace Sass {
238
238
  return debubble(mm->block(), mm);
239
239
  }
240
240
 
241
- Statement* Cssize::operator()(Supports_Block* m)
241
+ Statement* Cssize::operator()(SupportsRule* m)
242
242
  {
243
243
  if (!m->block()->length())
244
244
  { return m; }
@@ -248,7 +248,7 @@ namespace Sass {
248
248
 
249
249
  p_stack.push_back(m);
250
250
 
251
- Supports_Block_Obj mm = SASS_MEMORY_NEW(Supports_Block,
251
+ SupportsRuleObj mm = SASS_MEMORY_NEW(SupportsRule,
252
252
  m->pstate(),
253
253
  m->condition(),
254
254
  operator()(m->block()));
@@ -259,7 +259,7 @@ namespace Sass {
259
259
  return debubble(mm->block(), mm);
260
260
  }
261
261
 
262
- Statement* Cssize::operator()(At_Root_Block* m)
262
+ Statement* Cssize::operator()(AtRootRule* m)
263
263
  {
264
264
  bool tmp = false;
265
265
  for (size_t i = 0, L = p_stack.size(); i < L; ++i) {
@@ -287,17 +287,17 @@ namespace Sass {
287
287
  return bubble(m);
288
288
  }
289
289
 
290
- Statement* Cssize::bubble(Directive* m)
290
+ Statement* Cssize::bubble(AtRule* m)
291
291
  {
292
292
  Block* bb = SASS_MEMORY_NEW(Block, this->parent()->pstate());
293
- Has_Block_Obj new_rule = Cast<Has_Block>(SASS_MEMORY_COPY(this->parent()));
293
+ ParentStatementObj new_rule = Cast<ParentStatement>(SASS_MEMORY_COPY(this->parent()));
294
294
  new_rule->block(bb);
295
295
  new_rule->tabs(this->parent()->tabs());
296
296
  new_rule->block()->concat(m->block());
297
297
 
298
298
  Block_Obj wrapper_block = SASS_MEMORY_NEW(Block, m->block() ? m->block()->pstate() : m->pstate());
299
299
  wrapper_block->append(new_rule);
300
- Directive_Obj mm = SASS_MEMORY_NEW(Directive,
300
+ AtRuleObj mm = SASS_MEMORY_NEW(AtRule,
301
301
  m->pstate(),
302
302
  m->keyword(),
303
303
  m->selector(),
@@ -308,11 +308,11 @@ namespace Sass {
308
308
  return bubble;
309
309
  }
310
310
 
311
- Statement* Cssize::bubble(At_Root_Block* m)
311
+ Statement* Cssize::bubble(AtRootRule* m)
312
312
  {
313
313
  if (!m || !m->block()) return NULL;
314
314
  Block* bb = SASS_MEMORY_NEW(Block, this->parent()->pstate());
315
- Has_Block_Obj new_rule = Cast<Has_Block>(SASS_MEMORY_COPY(this->parent()));
315
+ ParentStatementObj new_rule = Cast<ParentStatement>(SASS_MEMORY_COPY(this->parent()));
316
316
  Block* wrapper_block = SASS_MEMORY_NEW(Block, m->block()->pstate());
317
317
  if (new_rule) {
318
318
  new_rule->block(bb);
@@ -321,7 +321,7 @@ namespace Sass {
321
321
  wrapper_block->append(new_rule);
322
322
  }
323
323
 
324
- At_Root_Block* mm = SASS_MEMORY_NEW(At_Root_Block,
324
+ AtRootRule* mm = SASS_MEMORY_NEW(AtRootRule,
325
325
  m->pstate(),
326
326
  wrapper_block,
327
327
  m->expression());
@@ -329,12 +329,12 @@ namespace Sass {
329
329
  return bubble;
330
330
  }
331
331
 
332
- Statement* Cssize::bubble(Supports_Block* m)
332
+ Statement* Cssize::bubble(SupportsRule* m)
333
333
  {
334
- Ruleset_Obj parent = Cast<Ruleset>(SASS_MEMORY_COPY(this->parent()));
334
+ StyleRuleObj parent = Cast<StyleRule>(SASS_MEMORY_COPY(this->parent()));
335
335
 
336
336
  Block* bb = SASS_MEMORY_NEW(Block, parent->block()->pstate());
337
- Ruleset* new_rule = SASS_MEMORY_NEW(Ruleset,
337
+ StyleRule* new_rule = SASS_MEMORY_NEW(StyleRule,
338
338
  parent->pstate(),
339
339
  parent->selector(),
340
340
  bb);
@@ -343,7 +343,7 @@ namespace Sass {
343
343
 
344
344
  Block* wrapper_block = SASS_MEMORY_NEW(Block, m->block()->pstate());
345
345
  wrapper_block->append(new_rule);
346
- Supports_Block* mm = SASS_MEMORY_NEW(Supports_Block,
346
+ SupportsRule* mm = SASS_MEMORY_NEW(SupportsRule,
347
347
  m->pstate(),
348
348
  m->condition(),
349
349
  wrapper_block);
@@ -356,10 +356,10 @@ namespace Sass {
356
356
 
357
357
  Statement* Cssize::bubble(CssMediaRule* m)
358
358
  {
359
- Ruleset_Obj parent = Cast<Ruleset>(SASS_MEMORY_COPY(this->parent()));
359
+ StyleRuleObj parent = Cast<StyleRule>(SASS_MEMORY_COPY(this->parent()));
360
360
 
361
361
  Block* bb = SASS_MEMORY_NEW(Block, parent->block()->pstate());
362
- Ruleset* new_rule = SASS_MEMORY_NEW(Ruleset,
362
+ StyleRule* new_rule = SASS_MEMORY_NEW(StyleRule,
363
363
  parent->pstate(),
364
364
  parent->selector(),
365
365
  bb);
@@ -380,7 +380,7 @@ namespace Sass {
380
380
 
381
381
  bool Cssize::bubblable(Statement* s)
382
382
  {
383
- return Cast<Ruleset>(s) || s->bubbles();
383
+ return Cast<StyleRule>(s) || (s && s->bubbles());
384
384
  }
385
385
 
386
386
  Block* Cssize::flatten(const Block* b)
@@ -401,9 +401,9 @@ namespace Sass {
401
401
  return result;
402
402
  }
403
403
 
404
- std::vector<std::pair<bool, Block_Obj>> Cssize::slice_by_bubble(Block* b)
404
+ sass::vector<std::pair<bool, Block_Obj>> Cssize::slice_by_bubble(Block* b)
405
405
  {
406
- std::vector<std::pair<bool, Block_Obj>> results;
406
+ sass::vector<std::pair<bool, Block_Obj>> results;
407
407
 
408
408
  for (size_t i = 0, L = b->length(); i < L; ++i) {
409
409
  Statement_Obj value = b->at(i);
@@ -426,8 +426,8 @@ namespace Sass {
426
426
 
427
427
  Block* Cssize::debubble(Block* children, Statement* parent)
428
428
  {
429
- Has_Block_Obj previous_parent;
430
- std::vector<std::pair<bool, Block_Obj>> baz = slice_by_bubble(children);
429
+ ParentStatementObj previous_parent;
430
+ sass::vector<std::pair<bool, Block_Obj>> baz = slice_by_bubble(children);
431
431
  Block_Obj result = SASS_MEMORY_NEW(Block, children->pstate());
432
432
 
433
433
  for (size_t i = 0, L = baz.size(); i < L; ++i) {
@@ -479,7 +479,8 @@ namespace Sass {
479
479
  children->pstate(),
480
480
  children->length(),
481
481
  children->is_root());
482
- bb->append(ss->perform(this));
482
+ auto evaled = ss->perform(this);
483
+ if (evaled) bb->append(evaled);
483
484
 
484
485
  Block_Obj wrapper_block = SASS_MEMORY_NEW(Block,
485
486
  children->pstate(),
@@ -14,32 +14,32 @@ namespace Sass {
14
14
 
15
15
  Backtraces& traces;
16
16
  BlockStack block_stack;
17
- std::vector<Statement*> p_stack;
17
+ sass::vector<Statement*> p_stack;
18
18
 
19
19
  public:
20
20
  Cssize(Context&);
21
21
  ~Cssize() { }
22
22
 
23
23
  Block* operator()(Block*);
24
- Statement* operator()(Ruleset*);
24
+ Statement* operator()(StyleRule*);
25
25
  // Statement* operator()(Bubble*);
26
26
  Statement* operator()(CssMediaRule*);
27
- Statement* operator()(Supports_Block*);
28
- Statement* operator()(At_Root_Block*);
29
- Statement* operator()(Directive*);
27
+ Statement* operator()(SupportsRule*);
28
+ Statement* operator()(AtRootRule*);
29
+ Statement* operator()(AtRule*);
30
30
  Statement* operator()(Keyframe_Rule*);
31
31
  Statement* operator()(Trace*);
32
32
  Statement* operator()(Declaration*);
33
33
  // Statement* operator()(Assignment*);
34
34
  // Statement* operator()(Import*);
35
35
  // Statement* operator()(Import_Stub*);
36
- // Statement* operator()(Warning*);
36
+ // Statement* operator()(WarningRule*);
37
37
  // Statement* operator()(Error*);
38
38
  // Statement* operator()(Comment*);
39
39
  // Statement* operator()(If*);
40
- // Statement* operator()(For*);
41
- // Statement* operator()(Each*);
42
- // Statement* operator()(While*);
40
+ // Statement* operator()(ForRule*);
41
+ // Statement* operator()(EachRule*);
42
+ // Statement* operator()(WhileRule*);
43
43
  // Statement* operator()(Return*);
44
44
  // Statement* operator()(ExtendRule*);
45
45
  // Statement* operator()(Definition*);
@@ -48,11 +48,11 @@ namespace Sass {
48
48
  Statement* operator()(Null*);
49
49
 
50
50
  Statement* parent();
51
- std::vector<std::pair<bool, Block_Obj>> slice_by_bubble(Block*);
52
- Statement* bubble(Directive*);
53
- Statement* bubble(At_Root_Block*);
51
+ sass::vector<std::pair<bool, Block_Obj>> slice_by_bubble(Block*);
52
+ Statement* bubble(AtRule*);
53
+ Statement* bubble(AtRootRule*);
54
54
  Statement* bubble(CssMediaRule*);
55
- Statement* bubble(Supports_Block*);
55
+ Statement* bubble(SupportsRule*);
56
56
 
57
57
  Block* debubble(Block* children, Statement* parent = 0);
58
58
  Block* flatten(const Block*);
@@ -12,7 +12,7 @@ namespace Sass {
12
12
  // Flatten `vector<vector<T>>` to `vector<T>`
13
13
  // ##########################################################################
14
14
  template <class T>
15
- T flatten(const std::vector<T>& all)
15
+ T flatten(const sass::vector<T>& all)
16
16
  {
17
17
  T flattened;
18
18
  for (const auto& sub : all) {
@@ -42,7 +42,7 @@ namespace Sass {
42
42
  // ##########################################################################
43
43
  // ##########################################################################
44
44
  template <class T>
45
- T flattenInner(const std::vector<T>& vec)
45
+ T flattenInner(const sass::vector<T>& vec)
46
46
  {
47
47
  T outer;
48
48
  for (const auto& sub : vec) {
@@ -102,8 +102,8 @@ namespace Sass {
102
102
  // Longest common subsequence with predicate
103
103
  // ##########################################################################
104
104
  template <class T>
105
- std::vector<T> lcs(
106
- const std::vector<T>& X, const std::vector<T>& Y,
105
+ sass::vector<T> lcs(
106
+ const sass::vector<T>& X, const sass::vector<T>& Y,
107
107
  bool(*select)(const T&, const T&, T&) = lcsIdentityCmp<T>)
108
108
  {
109
109
 
@@ -142,7 +142,7 @@ namespace Sass {
142
142
  }
143
143
 
144
144
  // Following code is used to print LCS
145
- std::vector<T> lcs;
145
+ sass::vector<T> lcs;
146
146
  std::size_t index = LEN(m, n);
147
147
  lcs.reserve(index);
148
148
 
@@ -17,15 +17,15 @@
17
17
 
18
18
  using namespace Sass;
19
19
 
20
- inline void debug_ast(AST_Node* node, std::string ind = "", Env* env = 0);
20
+ inline void debug_ast(AST_Node* node, sass::string ind = "", Env* env = 0);
21
21
 
22
- inline std::string debug_vec(const AST_Node* node) {
22
+ inline sass::string debug_vec(const AST_Node* node) {
23
23
  if (node == NULL) return "null";
24
24
  else return node->to_string();
25
25
  }
26
26
 
27
- inline std::string debug_dude(std::vector<std::vector<int>> vec) {
28
- std::stringstream out;
27
+ inline sass::string debug_dude(sass::vector<sass::vector<int>> vec) {
28
+ sass::sstream out;
29
29
  out << "{";
30
30
  bool joinOut = false;
31
31
  for (auto ct : vec) {
@@ -44,12 +44,12 @@ inline std::string debug_dude(std::vector> vec) {
44
44
  return out.str();
45
45
  }
46
46
 
47
- inline std::string debug_vec(std::string& str) {
47
+ inline sass::string debug_vec(sass::string& str) {
48
48
  return str;
49
49
  }
50
50
 
51
- inline std::string debug_vec(Extension& ext) {
52
- std::stringstream out;
51
+ inline sass::string debug_vec(Extension& ext) {
52
+ sass::sstream out;
53
53
  out << debug_vec(ext.extender);
54
54
  out << " {@extend ";
55
55
  out << debug_vec(ext.target);
@@ -61,8 +61,8 @@ inline std::string debug_vec(Extension& ext) {
61
61
  }
62
62
 
63
63
  template <class T>
64
- inline std::string debug_vec(std::vector<T> vec) {
65
- std::stringstream out;
64
+ inline sass::string debug_vec(sass::vector<T> vec) {
65
+ sass::sstream out;
66
66
  out << "[";
67
67
  for (size_t i = 0; i < vec.size(); i += 1) {
68
68
  if (i > 0) out << ", ";
@@ -73,8 +73,8 @@ inline std::string debug_vec(std::vector vec) {
73
73
  }
74
74
 
75
75
  template <class T>
76
- inline std::string debug_vec(std::queue<T> vec) {
77
- std::stringstream out;
76
+ inline sass::string debug_vec(std::queue<T> vec) {
77
+ sass::sstream out;
78
78
  out << "{";
79
79
  for (size_t i = 0; i < vec.size(); i += 1) {
80
80
  if (i > 0) out << ", ";
@@ -85,8 +85,8 @@ inline std::string debug_vec(std::queue vec) {
85
85
  }
86
86
 
87
87
  template <class T, class U, class O>
88
- inline std::string debug_vec(std::map<T, U, O> vec) {
89
- std::stringstream out;
88
+ inline sass::string debug_vec(std::map<T, U, O> vec) {
89
+ sass::sstream out;
90
90
  out << "{";
91
91
  bool joinit = false;
92
92
  for (auto it = vec.begin(); it != vec.end(); it++)
@@ -102,8 +102,8 @@ inline std::string debug_vec(std::map vec) {
102
102
  }
103
103
 
104
104
  template <class T, class U, class O, class V>
105
- inline std::string debug_vec(const ordered_map<T, U, O, V>& vec) {
106
- std::stringstream out;
105
+ inline sass::string debug_vec(const ordered_map<T, U, O, V>& vec) {
106
+ sass::sstream out;
107
107
  out << "{";
108
108
  bool joinit = false;
109
109
  for (auto it = vec.begin(); it != vec.end(); it++)
@@ -118,8 +118,8 @@ inline std::string debug_vec(const ordered_map& vec) {
118
118
  }
119
119
 
120
120
  template <class T, class U, class O, class V>
121
- inline std::string debug_vec(std::unordered_map<T, U, O, V> vec) {
122
- std::stringstream out;
121
+ inline sass::string debug_vec(std::unordered_map<T, U, O, V> vec) {
122
+ sass::sstream out;
123
123
  out << "{";
124
124
  bool joinit = false;
125
125
  for (auto it = vec.begin(); it != vec.end(); it++)
@@ -135,8 +135,8 @@ inline std::string debug_vec(std::unordered_map vec) {
135
135
  }
136
136
 
137
137
  template <class T, class U, class O, class V>
138
- inline std::string debug_keys(std::unordered_map<T, U, O, V> vec) {
139
- std::stringstream out;
138
+ inline sass::string debug_keys(std::unordered_map<T, U, O, V> vec) {
139
+ sass::sstream out;
140
140
  out << "{";
141
141
  bool joinit = false;
142
142
  for (auto it = vec.begin(); it != vec.end(); it++)
@@ -149,8 +149,8 @@ inline std::string debug_keys(std::unordered_map vec) {
149
149
  return out.str();
150
150
  }
151
151
 
152
- inline std::string debug_vec(ExtListSelSet& vec) {
153
- std::stringstream out;
152
+ inline sass::string debug_vec(ExtListSelSet& vec) {
153
+ sass::sstream out;
154
154
  out << "{";
155
155
  bool joinit = false;
156
156
  for (auto it = vec.begin(); it != vec.end(); it++)
@@ -165,8 +165,8 @@ inline std::string debug_vec(ExtListSelSet& vec) {
165
165
 
166
166
  /*
167
167
  template <class T, class U, class O, class V>
168
- inline std::string debug_values(tsl::ordered_map<T, U, O, V> vec) {
169
- std::stringstream out;
168
+ inline sass::string debug_values(tsl::ordered_map<T, U, O, V> vec) {
169
+ sass::sstream out;
170
170
  out << "{";
171
171
  bool joinit = false;
172
172
  for (auto it = vec.begin(); it != vec.end(); it++)
@@ -180,8 +180,8 @@ inline std::string debug_values(tsl::ordered_map vec) {
180
180
  }
181
181
 
182
182
  template <class T, class U, class O, class V>
183
- inline std::string debug_vec(tsl::ordered_map<T, U, O, V> vec) {
184
- std::stringstream out;
183
+ inline sass::string debug_vec(tsl::ordered_map<T, U, O, V> vec) {
184
+ sass::sstream out;
185
185
  out << "{";
186
186
  bool joinit = false;
187
187
  for (auto it = vec.begin(); it != vec.end(); it++)
@@ -197,8 +197,8 @@ inline std::string debug_vec(tsl::ordered_map vec) {
197
197
  }
198
198
 
199
199
  template <class T, class U, class O, class V>
200
- inline std::string debug_vals(tsl::ordered_map<T, U, O, V> vec) {
201
- std::stringstream out;
200
+ inline sass::string debug_vals(tsl::ordered_map<T, U, O, V> vec) {
201
+ sass::sstream out;
202
202
  out << "{";
203
203
  bool joinit = false;
204
204
  for (auto it = vec.begin(); it != vec.end(); it++)
@@ -212,8 +212,8 @@ inline std::string debug_vals(tsl::ordered_map vec) {
212
212
  }
213
213
 
214
214
  template <class T, class U, class O, class V>
215
- inline std::string debug_keys(tsl::ordered_map<T, U, O, V> vec) {
216
- std::stringstream out;
215
+ inline sass::string debug_keys(tsl::ordered_map<T, U, O, V> vec) {
216
+ sass::sstream out;
217
217
  out << "{";
218
218
  bool joinit = false;
219
219
  for (auto it = vec.begin(); it != vec.end(); it++)
@@ -228,8 +228,8 @@ inline std::string debug_keys(tsl::ordered_map vec) {
228
228
  */
229
229
 
230
230
  template <class T, class U>
231
- inline std::string debug_vec(std::set<T, U> vec) {
232
- std::stringstream out;
231
+ inline sass::string debug_vec(std::set<T, U> vec) {
232
+ sass::sstream out;
233
233
  out << "{";
234
234
  bool joinit = false;
235
235
  for (auto item : vec) {
@@ -243,8 +243,8 @@ inline std::string debug_vec(std::set vec) {
243
243
 
244
244
  /*
245
245
  template <class T, class U, class O, class V>
246
- inline std::string debug_vec(tsl::ordered_set<T, U, O, V> vec) {
247
- std::stringstream out;
246
+ inline sass::string debug_vec(tsl::ordered_set<T, U, O, V> vec) {
247
+ sass::sstream out;
248
248
  out << "{";
249
249
  bool joinit = false;
250
250
  for (auto item : vec) {
@@ -258,8 +258,8 @@ inline std::string debug_vec(tsl::ordered_set vec) {
258
258
  */
259
259
 
260
260
  template <class T, class U, class O, class V>
261
- inline std::string debug_vec(std::unordered_set<T, U, O, V> vec) {
262
- std::stringstream out;
261
+ inline sass::string debug_vec(std::unordered_set<T, U, O, V> vec) {
262
+ sass::sstream out;
263
263
  out << "{";
264
264
  bool joinit = false;
265
265
  for (auto item : vec) {
@@ -271,22 +271,22 @@ inline std::string debug_vec(std::unordered_set vec) {
271
271
  return out.str();
272
272
  }
273
273
 
274
- inline std::string debug_bool(bool val) {
274
+ inline sass::string debug_bool(bool val) {
275
275
  return val ? "true" : "false";
276
276
  }
277
- inline std::string debug_vec(ExtSmplSelSet* node) {
277
+ inline sass::string debug_vec(ExtSmplSelSet* node) {
278
278
  if (node == NULL) return "null";
279
279
  else return debug_vec(*node);
280
280
  }
281
281
 
282
- inline void debug_ast(const AST_Node* node, std::string ind = "", Env* env = 0) {
282
+ inline void debug_ast(const AST_Node* node, sass::string ind = "", Env* env = 0) {
283
283
  debug_ast(const_cast<AST_Node*>(node), ind, env);
284
284
  }
285
285
 
286
- inline std::string str_replace(std::string str, const std::string& oldStr, const std::string& newStr)
286
+ inline sass::string str_replace(sass::string str, const sass::string& oldStr, const sass::string& newStr)
287
287
  {
288
288
  size_t pos = 0;
289
- while((pos = str.find(oldStr, pos)) != std::string::npos)
289
+ while((pos = str.find(oldStr, pos)) != sass::string::npos)
290
290
  {
291
291
  str.replace(pos, oldStr.length(), newStr);
292
292
  pos += newStr.length();
@@ -294,25 +294,26 @@ inline std::string str_replace(std::string str, const std::string& oldStr, const
294
294
  return str;
295
295
  }
296
296
 
297
- inline std::string prettyprint(const std::string& str) {
298
- std::string clean = str_replace(str, "\n", "\\n");
297
+ inline sass::string prettyprint(const sass::string& str) {
298
+ sass::string clean = str_replace(str, "\n", "\\n");
299
299
  clean = str_replace(clean, " ", "\\t");
300
300
  clean = str_replace(clean, "\r", "\\r");
301
301
  return clean;
302
302
  }
303
303
 
304
- inline std::string longToHex(long long t) {
305
- std::stringstream is;
304
+ inline sass::string longToHex(long long t) {
305
+ sass::sstream is;
306
306
  is << std::hex << t;
307
307
  return is.str();
308
308
  }
309
309
 
310
- inline std::string pstate_source_position(AST_Node* node)
310
+ inline sass::string pstate_source_position(AST_Node* node)
311
311
  {
312
- std::stringstream str;
313
- Position start(node->pstate());
314
- Position end(start + node->pstate().offset);
315
- str << (start.file == std::string::npos ? 99999999 : start.file)
312
+ sass::sstream str;
313
+ Offset start(node->pstate().position);
314
+ Offset end(start + node->pstate().offset);
315
+ size_t file = node->pstate().getSrcId();
316
+ str << (file == sass::string::npos ? 99999999 : file)
316
317
  << "@[" << start.line << ":" << start.column << "]"
317
318
  << "-[" << end.line << ":" << end.column << "]";
318
319
  #ifdef DEBUG_SHARED_PTR
@@ -323,7 +324,7 @@ inline std::string pstate_source_position(AST_Node* node)
323
324
  return str.str();
324
325
  }
325
326
 
326
- inline void debug_ast(AST_Node* node, std::string ind, Env* env)
327
+ inline void debug_ast(AST_Node* node, sass::string ind, Env* env)
327
328
  {
328
329
  if (node == 0) return;
329
330
  if (ind == "") std::cerr << "####################################################################\n";
@@ -341,9 +342,9 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
341
342
  << " [name:" << trace->name() << ", type: " << trace->type() << "]"
342
343
  << std::endl;
343
344
  debug_ast(trace->block(), ind + " ", env);
344
- } else if (Cast<At_Root_Block>(node)) {
345
- At_Root_Block* root_block = Cast<At_Root_Block>(node);
346
- std::cerr << ind << "At_Root_Block " << root_block;
345
+ } else if (Cast<AtRootRule>(node)) {
346
+ AtRootRule* root_block = Cast<AtRootRule>(node);
347
+ std::cerr << ind << "AtRootRule " << root_block;
347
348
  std::cerr << " (" << pstate_source_position(node) << ")";
348
349
  std::cerr << " " << root_block->tabs();
349
350
  std::cerr << std::endl;
@@ -392,7 +393,7 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
392
393
  << (selector->has_real_parent_ref() ? " [real parent]": " -")
393
394
  << " -- ";
394
395
 
395
- std::string del;
396
+ sass::string del;
396
397
  switch (selector->combinator()) {
397
398
  case SelectorCombinator::CHILD: del = ">"; break;
398
399
  case SelectorCombinator::GENERAL: del = "~"; break;
@@ -419,11 +420,11 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
419
420
  std::cerr << ind << "Parent_Reference " << selector;
420
421
  std::cerr << " (" << pstate_source_position(node) << ")";
421
422
  std::cerr << " <" << selector->hash() << ">";
422
- std::cerr << " <" << prettyprint(selector->pstate().token.ws_before()) << ">" << std::endl;
423
+ std::cerr << std::endl;
423
424
 
424
- } else if (Cast<Pseudo_Selector>(node)) {
425
- Pseudo_Selector* selector = Cast<Pseudo_Selector>(node);
426
- std::cerr << ind << "Pseudo_Selector " << selector;
425
+ } else if (Cast<PseudoSelector>(node)) {
426
+ PseudoSelector* selector = Cast<PseudoSelector>(node);
427
+ std::cerr << ind << "PseudoSelector " << selector;
427
428
  std::cerr << " (" << pstate_source_position(node) << ")";
428
429
  std::cerr << " <" << selector->hash() << ">";
429
430
  std::cerr << " <<" << selector->ns_name() << ">>";
@@ -432,40 +433,39 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
432
433
  std::cerr << std::endl;
433
434
  debug_ast(selector->argument(), ind + " <= ", env);
434
435
  debug_ast(selector->selector(), ind + " || ", env);
435
- } else if (Cast<Attribute_Selector>(node)) {
436
- Attribute_Selector* selector = Cast<Attribute_Selector>(node);
437
- std::cerr << ind << "Attribute_Selector " << selector;
436
+ } else if (Cast<AttributeSelector>(node)) {
437
+ AttributeSelector* selector = Cast<AttributeSelector>(node);
438
+ std::cerr << ind << "AttributeSelector " << selector;
438
439
  std::cerr << " (" << pstate_source_position(node) << ")";
439
440
  std::cerr << " <" << selector->hash() << ">";
440
441
  std::cerr << " <<" << selector->ns_name() << ">>";
441
442
  std::cerr << std::endl;
442
443
  debug_ast(selector->value(), ind + "[" + selector->matcher() + "] ", env);
443
- } else if (Cast<Class_Selector>(node)) {
444
- Class_Selector* selector = Cast<Class_Selector>(node);
445
- std::cerr << ind << "Class_Selector " << selector;
444
+ } else if (Cast<ClassSelector>(node)) {
445
+ ClassSelector* selector = Cast<ClassSelector>(node);
446
+ std::cerr << ind << "ClassSelector " << selector;
446
447
  std::cerr << " (" << pstate_source_position(node) << ")";
447
448
  std::cerr << " <" << selector->hash() << ">";
448
449
  std::cerr << " <<" << selector->ns_name() << ">>";
449
450
  std::cerr << std::endl;
450
- } else if (Cast<Id_Selector>(node)) {
451
- Id_Selector* selector = Cast<Id_Selector>(node);
452
- std::cerr << ind << "Id_Selector " << selector;
451
+ } else if (Cast<IDSelector>(node)) {
452
+ IDSelector* selector = Cast<IDSelector>(node);
453
+ std::cerr << ind << "IDSelector " << selector;
453
454
  std::cerr << " (" << pstate_source_position(node) << ")";
454
455
  std::cerr << " <" << selector->hash() << ">";
455
456
  std::cerr << " <<" << selector->ns_name() << ">>";
456
457
  std::cerr << std::endl;
457
- } else if (Cast<Type_Selector>(node)) {
458
- Type_Selector* selector = Cast<Type_Selector>(node);
459
- std::cerr << ind << "Type_Selector " << selector;
458
+ } else if (Cast<TypeSelector>(node)) {
459
+ TypeSelector* selector = Cast<TypeSelector>(node);
460
+ std::cerr << ind << "TypeSelector " << selector;
460
461
  std::cerr << " (" << pstate_source_position(node) << ")";
461
462
  std::cerr << " <" << selector->hash() << ">";
462
463
  std::cerr << " <<" << selector->ns_name() << ">>";
463
- std::cerr << " <" << prettyprint(selector->pstate().token.ws_before()) << ">";
464
464
  std::cerr << std::endl;
465
- } else if (Cast<Placeholder_Selector>(node)) {
465
+ } else if (Cast<PlaceholderSelector>(node)) {
466
466
 
467
- Placeholder_Selector* selector = Cast<Placeholder_Selector>(node);
468
- std::cerr << ind << "Placeholder_Selector [" << selector->ns_name() << "] " << selector;
467
+ PlaceholderSelector* selector = Cast<PlaceholderSelector>(node);
468
+ std::cerr << ind << "PlaceholderSelector [" << selector->ns_name() << "] " << selector;
469
469
  std::cerr << " (" << pstate_source_position(selector) << ")"
470
470
  << " <" << selector->hash() << ">"
471
471
  << (selector->isInvisible() ? " [isInvisible]" : " -")
@@ -537,23 +537,23 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
537
537
  std::cerr << " [" << (query->type()) << "] ";
538
538
  std::cerr << " " << debug_vec(query->features());
539
539
  std::cerr << std::endl;
540
- } else if (Cast<Supports_Block>(node)) {
541
- Supports_Block* block = Cast<Supports_Block>(node);
542
- std::cerr << ind << "Supports_Block " << block;
540
+ } else if (Cast<SupportsRule>(node)) {
541
+ SupportsRule* block = Cast<SupportsRule>(node);
542
+ std::cerr << ind << "SupportsRule " << block;
543
543
  std::cerr << " (" << pstate_source_position(node) << ")";
544
544
  std::cerr << " " << block->tabs() << std::endl;
545
545
  debug_ast(block->condition(), ind + " =@ ");
546
546
  debug_ast(block->block(), ind + " <>");
547
- } else if (Cast<Supports_Operator>(node)) {
548
- Supports_Operator* block = Cast<Supports_Operator>(node);
549
- std::cerr << ind << "Supports_Operator " << block;
547
+ } else if (Cast<SupportsOperation>(node)) {
548
+ SupportsOperation* block = Cast<SupportsOperation>(node);
549
+ std::cerr << ind << "SupportsOperation " << block;
550
550
  std::cerr << " (" << pstate_source_position(node) << ")"
551
551
  << std::endl;
552
552
  debug_ast(block->left(), ind + " left) ");
553
553
  debug_ast(block->right(), ind + " right) ");
554
- } else if (Cast<Supports_Negation>(node)) {
555
- Supports_Negation* block = Cast<Supports_Negation>(node);
556
- std::cerr << ind << "Supports_Negation " << block;
554
+ } else if (Cast<SupportsNegation>(node)) {
555
+ SupportsNegation* block = Cast<SupportsNegation>(node);
556
+ std::cerr << ind << "SupportsNegation " << block;
557
557
  std::cerr << " (" << pstate_source_position(node) << ")"
558
558
  << std::endl;
559
559
  debug_ast(block->condition(), ind + " condition) ");
@@ -564,9 +564,9 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
564
564
  << std::endl;
565
565
  debug_ast(block->feature(), ind + " feature) ");
566
566
  debug_ast(block->value(), ind + " value) ");
567
- } else if (Cast<Supports_Declaration>(node)) {
568
- Supports_Declaration* block = Cast<Supports_Declaration>(node);
569
- std::cerr << ind << "Supports_Declaration " << block;
567
+ } else if (Cast<SupportsDeclaration>(node)) {
568
+ SupportsDeclaration* block = Cast<SupportsDeclaration>(node);
569
+ std::cerr << ind << "SupportsDeclaration " << block;
570
570
  std::cerr << " (" << pstate_source_position(node) << ")"
571
571
  << std::endl;
572
572
  debug_ast(block->feature(), ind + " feature) ");
@@ -579,20 +579,20 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
579
579
  if (root_block->isInvisible()) std::cerr << " [isInvisible]";
580
580
  std::cerr << " " << root_block->tabs() << std::endl;
581
581
  for(const Statement_Obj& i : root_block->elements()) { debug_ast(i, ind + " ", env); }
582
- } else if (Cast<Warning>(node)) {
583
- Warning* block = Cast<Warning>(node);
584
- std::cerr << ind << "Warning " << block;
582
+ } else if (Cast<WarningRule>(node)) {
583
+ WarningRule* block = Cast<WarningRule>(node);
584
+ std::cerr << ind << "WarningRule " << block;
585
585
  std::cerr << " (" << pstate_source_position(node) << ")";
586
586
  std::cerr << " " << block->tabs() << std::endl;
587
587
  debug_ast(block->message(), ind + " : ");
588
- } else if (Cast<Error>(node)) {
589
- Error* block = Cast<Error>(node);
590
- std::cerr << ind << "Error " << block;
588
+ } else if (Cast<ErrorRule>(node)) {
589
+ ErrorRule* block = Cast<ErrorRule>(node);
590
+ std::cerr << ind << "ErrorRule " << block;
591
591
  std::cerr << " (" << pstate_source_position(node) << ")";
592
592
  std::cerr << " " << block->tabs() << std::endl;
593
- } else if (Cast<Debug>(node)) {
594
- Debug* block = Cast<Debug>(node);
595
- std::cerr << ind << "Debug " << block;
593
+ } else if (Cast<DebugRule>(node)) {
594
+ DebugRule* block = Cast<DebugRule>(node);
595
+ std::cerr << ind << "DebugRule " << block;
596
596
  std::cerr << " (" << pstate_source_position(node) << ")";
597
597
  std::cerr << " " << block->tabs() << std::endl;
598
598
  debug_ast(block->value(), ind + " ");
@@ -600,8 +600,7 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
600
600
  Comment* block = Cast<Comment>(node);
601
601
  std::cerr << ind << "Comment " << block;
602
602
  std::cerr << " (" << pstate_source_position(node) << ")";
603
- std::cerr << " " << block->tabs() <<
604
- " <" << prettyprint(block->pstate().token.ws_before()) << ">" << std::endl;
603
+ std::cerr << " " << block->tabs() << std::endl;
605
604
  debug_ast(block->text(), ind + "// ", env);
606
605
  } else if (Cast<If>(node)) {
607
606
  If* block = Cast<If>(node);
@@ -640,7 +639,7 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
640
639
  std::cerr << ind << "Import " << block;
641
640
  std::cerr << " (" << pstate_source_position(node) << ")";
642
641
  std::cerr << " " << block->tabs() << std::endl;
643
- // std::vector<std::string> files_;
642
+ // sass::vector<sass::string> files_;
644
643
  for (auto imp : block->urls()) debug_ast(imp, ind + "@: ", env);
645
644
  debug_ast(block->import_queries(), ind + "@@ ");
646
645
  } else if (Cast<Assignment>(node)) {
@@ -659,35 +658,35 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
659
658
  debug_ast(block->value(), ind + " value: ", env);
660
659
  debug_ast(block->block(), ind + " ", env);
661
660
  } else if (Cast<Keyframe_Rule>(node)) {
662
- Keyframe_Rule* has_block = Cast<Keyframe_Rule>(node);
663
- std::cerr << ind << "Keyframe_Rule " << has_block;
661
+ Keyframe_Rule* ParentStatement = Cast<Keyframe_Rule>(node);
662
+ std::cerr << ind << "Keyframe_Rule " << ParentStatement;
664
663
  std::cerr << " (" << pstate_source_position(node) << ")";
665
- std::cerr << " " << has_block->tabs() << std::endl;
666
- if (has_block->name()) debug_ast(has_block->name(), ind + "@");
667
- if (has_block->block()) for(const Statement_Obj& i : has_block->block()->elements()) { debug_ast(i, ind + " ", env); }
668
- } else if (Cast<Directive>(node)) {
669
- Directive* block = Cast<Directive>(node);
670
- std::cerr << ind << "Directive " << block;
664
+ std::cerr << " " << ParentStatement->tabs() << std::endl;
665
+ if (ParentStatement->name()) debug_ast(ParentStatement->name(), ind + "@");
666
+ if (ParentStatement->block()) for(const Statement_Obj& i : ParentStatement->block()->elements()) { debug_ast(i, ind + " ", env); }
667
+ } else if (Cast<AtRule>(node)) {
668
+ AtRule* block = Cast<AtRule>(node);
669
+ std::cerr << ind << "AtRule " << block;
671
670
  std::cerr << " (" << pstate_source_position(node) << ")";
672
671
  std::cerr << " [" << block->keyword() << "] " << block->tabs() << std::endl;
673
672
  debug_ast(block->selector(), ind + "~", env);
674
673
  debug_ast(block->value(), ind + "+", env);
675
674
  if (block->block()) for(const Statement_Obj& i : block->block()->elements()) { debug_ast(i, ind + " ", env); }
676
- } else if (Cast<Each>(node)) {
677
- Each* block = Cast<Each>(node);
678
- std::cerr << ind << "Each " << block;
675
+ } else if (Cast<EachRule>(node)) {
676
+ EachRule* block = Cast<EachRule>(node);
677
+ std::cerr << ind << "EachRule " << block;
679
678
  std::cerr << " (" << pstate_source_position(node) << ")";
680
679
  std::cerr << " " << block->tabs() << std::endl;
681
680
  if (block->block()) for(const Statement_Obj& i : block->block()->elements()) { debug_ast(i, ind + " ", env); }
682
- } else if (Cast<For>(node)) {
683
- For* block = Cast<For>(node);
684
- std::cerr << ind << "For " << block;
681
+ } else if (Cast<ForRule>(node)) {
682
+ ForRule* block = Cast<ForRule>(node);
683
+ std::cerr << ind << "ForRule " << block;
685
684
  std::cerr << " (" << pstate_source_position(node) << ")";
686
685
  std::cerr << " " << block->tabs() << std::endl;
687
686
  if (block->block()) for(const Statement_Obj& i : block->block()->elements()) { debug_ast(i, ind + " ", env); }
688
- } else if (Cast<While>(node)) {
689
- While* block = Cast<While>(node);
690
- std::cerr << ind << "While " << block;
687
+ } else if (Cast<WhileRule>(node)) {
688
+ WhileRule* block = Cast<WhileRule>(node);
689
+ std::cerr << ind << "WhileRule " << block;
691
690
  std::cerr << " (" << pstate_source_position(node) << ")";
692
691
  std::cerr << " " << block->tabs() << std::endl;
693
692
  if (block->block()) for(const Statement_Obj& i : block->block()->elements()) { debug_ast(i, ind + " ", env); }
@@ -712,8 +711,8 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
712
711
  debug_ast(block->arguments(), ind + " args: ", env);
713
712
  debug_ast(block->block_parameters(), ind + " block_params: ", env);
714
713
  if (block->block()) debug_ast(block->block(), ind + " ", env);
715
- } else if (Ruleset* ruleset = Cast<Ruleset>(node)) {
716
- std::cerr << ind << "Ruleset " << ruleset;
714
+ } else if (StyleRule* ruleset = Cast<StyleRule>(node)) {
715
+ std::cerr << ind << "StyleRule " << ruleset;
717
716
  std::cerr << " (" << pstate_source_position(node) << ")";
718
717
  std::cerr << " [indent: " << ruleset->tabs() << "]";
719
718
  std::cerr << (ruleset->is_invisible() ? " [INVISIBLE]" : "");
@@ -734,7 +733,7 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
734
733
  std::cerr << " [interpolant: " << expression->is_interpolant() << "] ";
735
734
  std::cerr << " (" << pstate_source_position(node) << ")";
736
735
  std::cerr << " [" << expression->name() << "]" << std::endl;
737
- std::string name(expression->name());
736
+ sass::string name(expression->name());
738
737
  if (env && env->has(name)) debug_ast(Cast<Expression>((*env)[name]), ind + " -> ", env);
739
738
  } else if (Cast<Function_Call>(node)) {
740
739
  Function_Call* expression = Cast<Function_Call>(node);
@@ -881,7 +880,7 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
881
880
  if (expression->is_delayed()) std::cerr << " [delayed]";
882
881
  if (expression->is_interpolant()) std::cerr << " [interpolant]";
883
882
  if (expression->quote_mark()) std::cerr << " [quote_mark: " << expression->quote_mark() << "]";
884
- std::cerr << " <" << prettyprint(expression->pstate().token.ws_before()) << ">" << std::endl;
883
+ std::cerr << std::endl;
885
884
  } else if (Cast<String_Constant>(node)) {
886
885
  String_Constant* expression = Cast<String_Constant>(node);
887
886
  std::cerr << ind << "String_Constant " << expression;
@@ -892,7 +891,7 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
892
891
  std::cerr << " [" << prettyprint(expression->value()) << "]";
893
892
  if (expression->is_delayed()) std::cerr << " [delayed]";
894
893
  if (expression->is_interpolant()) std::cerr << " [interpolant]";
895
- std::cerr << " <" << prettyprint(expression->pstate().token.ws_before()) << ">" << std::endl;
894
+ std::cerr << std::endl;
896
895
  } else if (Cast<String_Schema>(node)) {
897
896
  String_Schema* expression = Cast<String_Schema>(node);
898
897
  std::cerr << ind << "String_Schema " << expression;
@@ -905,7 +904,7 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
905
904
  if (expression->has_interpolant()) std::cerr << " [has interpolant]";
906
905
  if (expression->is_left_interpolant()) std::cerr << " [left interpolant] ";
907
906
  if (expression->is_right_interpolant()) std::cerr << " [right interpolant] ";
908
- std::cerr << " <" << prettyprint(expression->pstate().token.ws_before()) << ">" << std::endl;
907
+ std::cerr << std::endl;
909
908
  for(const auto& i : expression->elements()) { debug_ast(i, ind + " ", env); }
910
909
  } else if (Cast<String>(node)) {
911
910
  String* expression = Cast<String>(node);
@@ -913,7 +912,7 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
913
912
  std::cerr << " " << expression->concrete_type();
914
913
  std::cerr << " (" << pstate_source_position(node) << ")";
915
914
  if (expression->is_interpolant()) std::cerr << " [interpolant]";
916
- std::cerr << " <" << prettyprint(expression->pstate().token.ws_before()) << ">" << std::endl;
915
+ std::cerr << std::endl;
917
916
  } else if (Cast<Expression>(node)) {
918
917
  Expression* expression = Cast<Expression>(node);
919
918
  std::cerr << ind << "Expression " << expression;
@@ -937,12 +936,12 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
937
936
  case Expression::Type::PARENT: std::cerr << " [PARENT]"; break;
938
937
  }
939
938
  std::cerr << std::endl;
940
- } else if (Cast<Has_Block>(node)) {
941
- Has_Block* has_block = Cast<Has_Block>(node);
942
- std::cerr << ind << "Has_Block " << has_block;
939
+ } else if (Cast<ParentStatement>(node)) {
940
+ ParentStatement* parent = Cast<ParentStatement>(node);
941
+ std::cerr << ind << "ParentStatement " << parent;
943
942
  std::cerr << " (" << pstate_source_position(node) << ")";
944
- std::cerr << " " << has_block->tabs() << std::endl;
945
- if (has_block->block()) for(const Statement_Obj& i : has_block->block()->elements()) { debug_ast(i, ind + " ", env); }
943
+ std::cerr << " " << parent->tabs() << std::endl;
944
+ if (parent->block()) for(const Statement_Obj& i : parent->block()->elements()) { debug_ast(i, ind + " ", env); }
946
945
  } else if (Cast<Statement>(node)) {
947
946
  Statement* statement = Cast<Statement>(node);
948
947
  std::cerr << ind << "Statement " << statement;
@@ -955,7 +954,7 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
955
954
 
956
955
 
957
956
  /*
958
- inline void debug_ast(const AST_Node* node, std::string ind = "", Env* env = 0)
957
+ inline void debug_ast(const AST_Node* node, sass::string ind = "", Env* env = 0)
959
958
  {
960
959
  debug_ast(const_cast<AST_Node*>(node), ind, env);
961
960
  }