File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ namespace Sass {
200200
201201 // abort if we are in function context and have nothing parsed yet
202202 else if (stack.back () == Scope::Function) {
203- error (" Functions can only contain variable declarations and control directives" , pstate);
203+ error (" Functions can only contain variable declarations and control directives. " , pstate);
204204 }
205205
206206 // parse imports to process later
@@ -340,7 +340,12 @@ namespace Sass {
340340 {
341341 Scope parent = stack.empty () ? Scope::Rules : stack.back ();
342342 if (parent != Scope::Root && parent != Scope::Rules && parent != Scope::Function) {
343- error (" Functions may not be defined within control directives or other mixins." , pstate);
343+ if (which_type == Definition::FUNCTION) {
344+ error (" Functions may not be defined within control directives or other mixins." , pstate);
345+ } else {
346+ error (" Mixins may not be defined within control directives or other mixins." , pstate);
347+ }
348+
344349 }
345350 std::string which_str (lexed);
346351 if (!lex< identifier >()) error (" invalid name in " + which_str + " definition" , pstate);
You can’t perform that action at this time.
0 commit comments