File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,17 @@ namespace Sass {
117
117
Selector_List* sel = dynamic_cast <Selector_List*>(ex);
118
118
if (sel == 0 ) throw std::runtime_error (" Expanded null selector" );
119
119
120
+ if (sel->length () == 0 || sel->has_parent_ref ()) {
121
+ bool has_parent_selector = false ;
122
+ for (size_t i = 0 , L = selector_stack.size (); i < L && !has_parent_selector; i++) {
123
+ Selector_List* ll = selector_stack.at (i);
124
+ has_parent_selector = ll != 0 && ll->length () > 0 ;
125
+ }
126
+ if (!has_parent_selector) {
127
+ error (" Base-level rules cannot contain the parent-selector-referencing character '&'." , sel->pstate (), backtrace ());
128
+ }
129
+ }
130
+
120
131
selector_stack.push_back (sel);
121
132
Env* env = 0 ;
122
133
if (block_stack.back ()->is_root ()) {
You can’t perform that action at this time.
0 commit comments