File tree Expand file tree Collapse file tree 3 files changed +8
-17
lines changed Expand file tree Collapse file tree 3 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,8 @@ namespace Sass {
11
11
current_mixin_definition(0 )
12
12
{ }
13
13
14
- Statement_Ptr CheckNesting::before (Statement_Ptr s) {
15
- if (this ->should_visit (s)) return s;
16
- return NULL ;
17
- }
18
-
19
- Statement_Ptr CheckNesting::visit_children (Statement_Ptr parent) {
20
-
14
+ Statement_Ptr CheckNesting::visit_children (Statement_Ptr parent)
15
+ {
21
16
Statement_Ptr old_parent = this ->parent ;
22
17
23
18
if (At_Root_Block_Ptr root = SASS_MEMORY_CAST_PTR (At_Root_Block, parent)) {
@@ -86,6 +81,7 @@ namespace Sass {
86
81
87
82
Statement_Ptr CheckNesting::operator ()(Definition_Ptr n)
88
83
{
84
+ if (!this ->should_visit (n)) return NULL ;
89
85
if (!is_mixin (n)) return n;
90
86
91
87
Definition_Ptr old_mixin_definition = this ->current_mixin_definition ;
Original file line number Diff line number Diff line change @@ -27,7 +27,11 @@ namespace Sass {
27
27
28
28
template <typename U>
29
29
Statement_Ptr fallback (U x) {
30
- return fallback_impl (this ->before (SASS_MEMORY_CAST_PTR (Statement, x)));
30
+ Statement_Ptr n = SASS_MEMORY_CAST_PTR (Statement, x);
31
+ if (this ->should_visit (n)) {
32
+ return fallback_impl (n);
33
+ }
34
+ return NULL ;
31
35
}
32
36
33
37
private:
Original file line number Diff line number Diff line change @@ -363,15 +363,6 @@ namespace Sass {
363
363
364
364
Definition_Obj Parser::parse_definition (Definition::Type which_type)
365
365
{
366
- Scope parent = stack.empty () ? Scope::Rules : stack.back ();
367
- if (parent != Scope::Root && parent != Scope::Rules && parent != Scope::Function) {
368
- if (which_type == Definition::FUNCTION) {
369
- error (" Functions may not be defined within control directives or other mixins." , pstate);
370
- } else {
371
- error (" Mixins may not be defined within control directives or other mixins." , pstate);
372
- }
373
-
374
- }
375
366
std::string which_str (lexed);
376
367
if (!lex< identifier >()) error (" invalid name in " + which_str + " definition" , pstate);
377
368
std::string name (Util::normalize_underscores (lexed));
You can’t perform that action at this time.
0 commit comments