sassc 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -2,20 +2,20 @@
2
2
 
3
3
  namespace Sass {
4
4
 
5
- const std::string traces_to_string(Backtraces traces, std::string indent) {
5
+ const sass::string traces_to_string(Backtraces traces, sass::string indent) {
6
6
 
7
- std::stringstream ss;
8
- std::string cwd(File::get_cwd());
7
+ sass::ostream ss;
8
+ sass::string cwd(File::get_cwd());
9
9
 
10
10
  bool first = true;
11
11
  size_t i_beg = traces.size() - 1;
12
- size_t i_end = std::string::npos;
12
+ size_t i_end = sass::string::npos;
13
13
  for (size_t i = i_beg; i != i_end; i --) {
14
14
 
15
15
  const Backtrace& trace = traces[i];
16
16
 
17
17
  // make path relative to the current directory
18
- std::string rel_path(File::abs2rel(trace.pstate.path, cwd, cwd));
18
+ sass::string rel_path(File::abs2rel(trace.pstate.getPath(), cwd, cwd));
19
19
 
20
20
  // skip functions on error cases (unsure why ruby sass does this)
21
21
  // if (trace.caller.substr(0, 6) == ", in f") continue;
@@ -23,9 +23,9 @@ namespace Sass {
23
23
  if (first) {
24
24
  ss << indent;
25
25
  ss << "on line ";
26
- ss << trace.pstate.line + 1;
26
+ ss << trace.pstate.getLine();
27
27
  ss << ":";
28
- ss << trace.pstate.column + 1;
28
+ ss << trace.pstate.getColumn();
29
29
  ss << " of " << rel_path;
30
30
  // ss << trace.caller;
31
31
  first = false;
@@ -34,9 +34,9 @@ namespace Sass {
34
34
  ss << std::endl;
35
35
  ss << indent;
36
36
  ss << "from line ";
37
- ss << trace.pstate.line + 1;
37
+ ss << trace.pstate.getLine();
38
38
  ss << ":";
39
- ss << trace.pstate.column + 1;
39
+ ss << trace.pstate.getColumn();
40
40
  ss << " of " << rel_path;
41
41
  }
42
42
 
@@ -10,19 +10,19 @@ namespace Sass {
10
10
 
11
11
  struct Backtrace {
12
12
 
13
- ParserState pstate;
14
- std::string caller;
13
+ SourceSpan pstate;
14
+ sass::string caller;
15
15
 
16
- Backtrace(ParserState pstate, std::string c = "")
16
+ Backtrace(SourceSpan pstate, sass::string c = "")
17
17
  : pstate(pstate),
18
18
  caller(c)
19
19
  { }
20
20
 
21
21
  };
22
22
 
23
- typedef std::vector<Backtrace> Backtraces;
23
+ typedef sass::vector<Backtrace> Backtraces;
24
24
 
25
- const std::string traces_to_string(Backtraces traces, std::string indent = "\t");
25
+ const sass::string traces_to_string(Backtraces traces, sass::string indent = "\t");
26
26
 
27
27
  }
28
28
 
@@ -6,9 +6,9 @@
6
6
 
7
7
  namespace Sass {
8
8
 
9
- std::string Base64VLQ::encode(const int number) const
9
+ sass::string Base64VLQ::encode(const int number) const
10
10
  {
11
- std::string encoded = "";
11
+ sass::string encoded = "";
12
12
 
13
13
  int vlq = to_vlq_signed(number);
14
14
 
@@ -9,7 +9,7 @@ namespace Sass {
9
9
 
10
10
  public:
11
11
 
12
- std::string encode(const int number) const;
12
+ sass::string encode(const int number) const;
13
13
 
14
14
  private:
15
15
 
@@ -11,11 +11,11 @@
11
11
 
12
12
  namespace Sass {
13
13
 
14
- void bind(std::string type, std::string name, Parameters_Obj ps, Arguments_Obj as, Env* env, Eval* eval, Backtraces& traces)
14
+ void bind(sass::string type, sass::string name, Parameters_Obj ps, Arguments_Obj as, Env* env, Eval* eval, Backtraces& traces)
15
15
  {
16
- std::string callee(type + " " + name);
16
+ sass::string callee(type + " " + name);
17
17
 
18
- std::map<std::string, Parameter_Obj> param_map;
18
+ std::map<sass::string, Parameter_Obj> param_map;
19
19
  List_Obj varargs = SASS_MEMORY_NEW(List, as->pstate());
20
20
  varargs->is_arglist(true); // enable keyword size handling
21
21
 
@@ -52,7 +52,7 @@ namespace Sass {
52
52
  }
53
53
  }
54
54
  }
55
- std::stringstream msg;
55
+ sass::ostream msg;
56
56
  msg << "wrong number of arguments (" << LA << " for " << LP << ")";
57
57
  msg << " for `" << name << "'";
58
58
  return error(msg.str(), as->pstate(), traces);
@@ -73,7 +73,7 @@ namespace Sass {
73
73
  rest->separator(),
74
74
  true);
75
75
  // wrap each item from list as an argument
76
- for (Expression_Obj item : rest->elements()) {
76
+ for (ExpressionObj item : rest->elements()) {
77
77
  if (Argument_Obj arg = Cast<Argument>(item)) {
78
78
  arglist->append(SASS_MEMORY_COPY(arg)); // copy
79
79
  } else {
@@ -100,7 +100,7 @@ namespace Sass {
100
100
  Map_Obj argmap = Cast<Map>(a->value());
101
101
  for (auto key : argmap->keys()) {
102
102
  if (String_Constant_Obj str = Cast<String_Constant>(key)) {
103
- std::string param = unquote(str->value());
103
+ sass::string param = unquote(str->value());
104
104
  arglist->append(SASS_MEMORY_NEW(Argument,
105
105
  key->pstate(),
106
106
  argmap->at(key),
@@ -130,7 +130,7 @@ namespace Sass {
130
130
  // skip any list completely if empty
131
131
  if (ls && ls->empty() && a->is_rest_argument()) continue;
132
132
 
133
- Expression_Obj value = a->value();
133
+ ExpressionObj value = a->value();
134
134
  if (Argument_Obj arg = Cast<Argument>(value)) {
135
135
  arglist->append(arg);
136
136
  }
@@ -141,7 +141,7 @@ namespace Sass {
141
141
  arglist->separator(rest->separator());
142
142
 
143
143
  for (size_t i = 0, L = rest->length(); i < L; ++i) {
144
- Expression_Obj obj = rest->value_at_index(i);
144
+ ExpressionObj obj = rest->value_at_index(i);
145
145
  arglist->append(SASS_MEMORY_NEW(Argument,
146
146
  obj->pstate(),
147
147
  obj,
@@ -177,7 +177,7 @@ namespace Sass {
177
177
  // normal param and rest arg
178
178
  List_Obj arglist = Cast<List>(a->value());
179
179
  if (!arglist) {
180
- if (Expression_Obj arg = Cast<Expression>(a->value())) {
180
+ if (ExpressionObj arg = Cast<Expression>(a->value())) {
181
181
  arglist = SASS_MEMORY_NEW(List, a->pstate(), 1);
182
182
  arglist->append(arg);
183
183
  }
@@ -189,7 +189,7 @@ namespace Sass {
189
189
  } else {
190
190
  if (arglist->length() > LP - ip && !ps->has_rest_parameter()) {
191
191
  size_t arg_count = (arglist->length() + LA - 1);
192
- std::stringstream msg;
192
+ sass::ostream msg;
193
193
  msg << callee << " takes " << LP;
194
194
  msg << (LP == 1 ? " argument" : " arguments");
195
195
  msg << " but " << arg_count;
@@ -202,7 +202,7 @@ namespace Sass {
202
202
  }
203
203
  }
204
204
  // otherwise move one of the rest args into the param, converting to argument if necessary
205
- Expression_Obj obj = arglist->at(0);
205
+ ExpressionObj obj = arglist->at(0);
206
206
  if (!(a = Cast<Argument>(obj))) {
207
207
  Expression* a_to_convert = obj;
208
208
  a = SASS_MEMORY_NEW(Argument,
@@ -226,10 +226,10 @@ namespace Sass {
226
226
  traces.push_back(Backtrace(key->pstate()));
227
227
  throw Exception::InvalidVarKwdType(key->pstate(), traces, key->inspect(), a);
228
228
  }
229
- std::string param = "$" + unquote(val->value());
229
+ sass::string param = "$" + unquote(val->value());
230
230
 
231
231
  if (!param_map.count(param)) {
232
- std::stringstream msg;
232
+ sass::ostream msg;
233
233
  msg << callee << " has no parameter named " << param;
234
234
  error(msg.str(), a->pstate(), traces);
235
235
  }
@@ -243,7 +243,7 @@ namespace Sass {
243
243
 
244
244
  if (a->name().empty()) {
245
245
  if (env->has_local(p->name())) {
246
- std::stringstream msg;
246
+ sass::ostream msg;
247
247
  msg << "parameter " << p->name()
248
248
  << " provided more than once in call to " << callee;
249
249
  error(msg.str(), a->pstate(), traces);
@@ -258,21 +258,21 @@ namespace Sass {
258
258
  if (ps->has_rest_parameter()) {
259
259
  varargs->append(a);
260
260
  } else {
261
- std::stringstream msg;
261
+ sass::ostream msg;
262
262
  msg << callee << " has no parameter named " << a->name();
263
263
  error(msg.str(), a->pstate(), traces);
264
264
  }
265
265
  }
266
266
  if (param_map[a->name()]) {
267
267
  if (param_map[a->name()]->is_rest_parameter()) {
268
- std::stringstream msg;
268
+ sass::ostream msg;
269
269
  msg << "argument " << a->name() << " of " << callee
270
270
  << "cannot be used as named argument";
271
271
  error(msg.str(), a->pstate(), traces);
272
272
  }
273
273
  }
274
274
  if (env->has_local(a->name())) {
275
- std::stringstream msg;
275
+ sass::ostream msg;
276
276
  msg << "parameter " << p->name()
277
277
  << "provided more than once in call to " << callee;
278
278
  error(msg.str(), a->pstate(), traces);
@@ -8,7 +8,7 @@
8
8
 
9
9
  namespace Sass {
10
10
 
11
- void bind(std::string type, std::string name, Parameters_Obj, Arguments_Obj, Env*, Eval*, Backtraces& traces);
11
+ void bind(sass::string type, sass::string name, Parameters_Obj, Arguments_Obj, Env*, Eval*, Backtraces& traces);
12
12
 
13
13
  }
14
14
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  namespace Sass {
10
10
 
11
- Value* c2ast(union Sass_Value* v, Backtraces traces, ParserState pstate)
11
+ Value* c2ast(union Sass_Value* v, Backtraces traces, SourceSpan pstate)
12
12
  {
13
13
  using std::strlen;
14
14
  using std::strcpy;
@@ -51,10 +51,10 @@ namespace Sass {
51
51
  e = SASS_MEMORY_NEW(Null, pstate);
52
52
  } break;
53
53
  case SASS_ERROR: {
54
- error("Error in C function: " + std::string(sass_error_get_message(v)), pstate, traces);
54
+ error("Error in C function: " + sass::string(sass_error_get_message(v)), pstate, traces);
55
55
  } break;
56
56
  case SASS_WARNING: {
57
- error("Warning in C function: " + std::string(sass_warning_get_message(v)), pstate, traces);
57
+ error("Warning in C function: " + sass::string(sass_warning_get_message(v)), pstate, traces);
58
58
  } break;
59
59
  default: break;
60
60
  }
@@ -7,7 +7,7 @@
7
7
 
8
8
  namespace Sass {
9
9
 
10
- Value* c2ast(union Sass_Value* v, Backtraces traces, ParserState pstate);
10
+ Value* c2ast(union Sass_Value* v, Backtraces traces, SourceSpan pstate);
11
11
 
12
12
  }
13
13
 
@@ -7,12 +7,12 @@
7
7
  namespace Sass {
8
8
 
9
9
  CheckNesting::CheckNesting()
10
- : parents(std::vector<Statement*>()),
11
- traces(std::vector<Backtrace>()),
10
+ : parents(sass::vector<Statement*>()),
11
+ traces(sass::vector<Backtrace>()),
12
12
  parent(0), current_mixin_definition(0)
13
13
  { }
14
14
 
15
- void error(AST_Node* node, Backtraces traces, std::string msg) {
15
+ void error(AST_Node* node, Backtraces traces, sass::string msg) {
16
16
  traces.push_back(Backtrace(node->pstate()));
17
17
  throw Exception::InvalidSass(node->pstate(), traces, msg);
18
18
  }
@@ -21,9 +21,9 @@ namespace Sass {
21
21
  {
22
22
  Statement* old_parent = this->parent;
23
23
 
24
- if (At_Root_Block* root = Cast<At_Root_Block>(parent)) {
25
- std::vector<Statement*> old_parents = this->parents;
26
- std::vector<Statement*> new_parents;
24
+ if (AtRootRule* root = Cast<AtRootRule>(parent)) {
25
+ sass::vector<Statement*> old_parents = this->parents;
26
+ sass::vector<Statement*> new_parents;
27
27
 
28
28
  for (size_t i = 0, L = this->parents.size(); i < L; i++) {
29
29
  Statement* p = this->parents.at(i);
@@ -45,7 +45,7 @@ namespace Sass {
45
45
  }
46
46
  }
47
47
 
48
- At_Root_Block* ar = Cast<At_Root_Block>(parent);
48
+ AtRootRule* ar = Cast<AtRootRule>(parent);
49
49
  Block* ret = ar->block();
50
50
 
51
51
  if (ret != NULL) {
@@ -75,7 +75,7 @@ namespace Sass {
75
75
  }
76
76
 
77
77
  if (!b) {
78
- if (Has_Block* bb = Cast<Has_Block>(parent)) {
78
+ if (ParentStatement* bb = Cast<ParentStatement>(parent)) {
79
79
  b = bb->block();
80
80
  }
81
81
  }
@@ -192,7 +192,7 @@ namespace Sass {
192
192
  void CheckNesting::invalid_extend_parent(Statement* parent, AST_Node* node)
193
193
  {
194
194
  if (!(
195
- Cast<Ruleset>(parent) ||
195
+ Cast<StyleRule>(parent) ||
196
196
  Cast<Mixin_Call>(parent) ||
197
197
  is_mixin(parent)
198
198
  )) {
@@ -204,10 +204,10 @@ namespace Sass {
204
204
  // {
205
205
  // for (auto pp : this->parents) {
206
206
  // if (
207
- // Cast<Each>(pp) ||
208
- // Cast<For>(pp) ||
207
+ // Cast<EachRule>(pp) ||
208
+ // Cast<ForRule>(pp) ||
209
209
  // Cast<If>(pp) ||
210
- // Cast<While>(pp) ||
210
+ // Cast<WhileRule>(pp) ||
211
211
  // Cast<Trace>(pp) ||
212
212
  // Cast<Mixin_Call>(pp) ||
213
213
  // is_mixin(pp)
@@ -229,10 +229,10 @@ namespace Sass {
229
229
  {
230
230
  for (Statement* pp : this->parents) {
231
231
  if (
232
- Cast<Each>(pp) ||
233
- Cast<For>(pp) ||
232
+ Cast<EachRule>(pp) ||
233
+ Cast<ForRule>(pp) ||
234
234
  Cast<If>(pp) ||
235
- Cast<While>(pp) ||
235
+ Cast<WhileRule>(pp) ||
236
236
  Cast<Trace>(pp) ||
237
237
  Cast<Mixin_Call>(pp) ||
238
238
  is_mixin(pp)
@@ -246,10 +246,10 @@ namespace Sass {
246
246
  {
247
247
  for (Statement* pp : this->parents) {
248
248
  if (
249
- Cast<Each>(pp) ||
250
- Cast<For>(pp) ||
249
+ Cast<EachRule>(pp) ||
250
+ Cast<ForRule>(pp) ||
251
251
  Cast<If>(pp) ||
252
- Cast<While>(pp) ||
252
+ Cast<WhileRule>(pp) ||
253
253
  Cast<Trace>(pp) ||
254
254
  Cast<Mixin_Call>(pp) ||
255
255
  is_mixin(pp)
@@ -262,19 +262,19 @@ namespace Sass {
262
262
  void CheckNesting::invalid_function_child(Statement* child)
263
263
  {
264
264
  if (!(
265
- Cast<Each>(child) ||
266
- Cast<For>(child) ||
265
+ Cast<EachRule>(child) ||
266
+ Cast<ForRule>(child) ||
267
267
  Cast<If>(child) ||
268
- Cast<While>(child) ||
268
+ Cast<WhileRule>(child) ||
269
269
  Cast<Trace>(child) ||
270
270
  Cast<Comment>(child) ||
271
- Cast<Debug>(child) ||
271
+ Cast<DebugRule>(child) ||
272
272
  Cast<Return>(child) ||
273
273
  Cast<Variable>(child) ||
274
274
  // Ruby Sass doesn't distinguish variables and assignments
275
275
  Cast<Assignment>(child) ||
276
- Cast<Warning>(child) ||
277
- Cast<Error>(child)
276
+ Cast<WarningRule>(child) ||
277
+ Cast<ErrorRule>(child)
278
278
  )) {
279
279
  error(child, traces, "Functions can only contain variable declarations and control directives.");
280
280
  }
@@ -283,10 +283,10 @@ namespace Sass {
283
283
  void CheckNesting::invalid_prop_child(Statement* child)
284
284
  {
285
285
  if (!(
286
- Cast<Each>(child) ||
287
- Cast<For>(child) ||
286
+ Cast<EachRule>(child) ||
287
+ Cast<ForRule>(child) ||
288
288
  Cast<If>(child) ||
289
- Cast<While>(child) ||
289
+ Cast<WhileRule>(child) ||
290
290
  Cast<Trace>(child) ||
291
291
  Cast<Comment>(child) ||
292
292
  Cast<Declaration>(child) ||
@@ -301,7 +301,7 @@ namespace Sass {
301
301
  if (!(
302
302
  is_mixin(parent) ||
303
303
  is_directive_node(parent) ||
304
- Cast<Ruleset>(parent) ||
304
+ Cast<StyleRule>(parent) ||
305
305
  Cast<Keyframe_Rule>(parent) ||
306
306
  Cast<Declaration>(parent) ||
307
307
  Cast<Mixin_Call>(parent)
@@ -343,17 +343,17 @@ namespace Sass {
343
343
  !is_at_root_node(grandparent);
344
344
 
345
345
  return Cast<Import>(parent) ||
346
- Cast<Each>(parent) ||
347
- Cast<For>(parent) ||
346
+ Cast<EachRule>(parent) ||
347
+ Cast<ForRule>(parent) ||
348
348
  Cast<If>(parent) ||
349
- Cast<While>(parent) ||
349
+ Cast<WhileRule>(parent) ||
350
350
  Cast<Trace>(parent) ||
351
351
  valid_bubble_node;
352
352
  }
353
353
 
354
354
  bool CheckNesting::is_charset(Statement* n)
355
355
  {
356
- Directive* d = Cast<Directive>(n);
356
+ AtRule* d = Cast<AtRule>(n);
357
357
  return d && d->keyword() == "charset";
358
358
  }
359
359
 
@@ -371,7 +371,7 @@ namespace Sass {
371
371
 
372
372
  bool CheckNesting::is_root_node(Statement* n)
373
373
  {
374
- if (Cast<Ruleset>(n)) return false;
374
+ if (Cast<StyleRule>(n)) return false;
375
375
 
376
376
  Block* b = Cast<Block>(n);
377
377
  return b && b->is_root();
@@ -379,15 +379,15 @@ namespace Sass {
379
379
 
380
380
  bool CheckNesting::is_at_root_node(Statement* n)
381
381
  {
382
- return Cast<At_Root_Block>(n) != NULL;
382
+ return Cast<AtRootRule>(n) != NULL;
383
383
  }
384
384
 
385
385
  bool CheckNesting::is_directive_node(Statement* n)
386
386
  {
387
- return Cast<Directive>(n) ||
387
+ return Cast<AtRule>(n) ||
388
388
  Cast<Import>(n) ||
389
389
  Cast<MediaRule>(n) ||
390
390
  Cast<CssMediaRule>(n) ||
391
- Cast<Supports_Block>(n);
391
+ Cast<SupportsRule>(n);
392
392
  }
393
393
  }