File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,10 +140,12 @@ namespace Sass {
140140 // parent selector only allowed at start
141141 // upcoming Sass may allow also trailing
142142 ParserState state (pstate);
143- SimpleSelectorObj prev = (*seq)[seq->length ()-1 ];
144- std::string sel (prev->to_string ({ NESTED, 5 }));
145143 std::string found (" &" );
146- if (lex < identifier >()) { found += std::string (lexed); }
144+ if (lex < identifier >()) {
145+ found += std::string (lexed);
146+ }
147+ std::string sel (seq->hasRealParent () ? " &" : " " );
148+ if (!seq->empty ()) { sel = seq->last ()->to_string ({ NESTED, 5 }); }
147149 // ToDo: parser should throw parser exceptions
148150 error (" Invalid CSS after \" " + sel + " \" : expected \" {\" , was \" " + found + " \"\n\n "
149151 " \" " + found + " \" may only be used at the beginning of a compound selector." , state);
You can’t perform that action at this time.
0 commit comments