File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -140,10 +140,12 @@ namespace Sass {
140
140
// parent selector only allowed at start
141
141
// upcoming Sass may allow also trailing
142
142
ParserState state (pstate);
143
- SimpleSelectorObj prev = (*seq)[seq->length ()-1 ];
144
- std::string sel (prev->to_string ({ NESTED, 5 }));
145
143
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 }); }
147
149
// ToDo: parser should throw parser exceptions
148
150
error (" Invalid CSS after \" " + sel + " \" : expected \" {\" , was \" " + found + " \"\n\n "
149
151
" \" " + 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