Expressions require a delimiter of some kind in mixin args

This commit is contained in:
Matthew Dean
2018-07-03 20:35:24 -07:00
parent d821a3754f
commit b79db65fa2
3 changed files with 16 additions and 3 deletions

View File

@@ -932,7 +932,7 @@ var Parser = function Parser(context, imports, fileInfo) {
returner = { args:null, variadic: false },
expressions = [], argsSemiColon = [], argsComma = [],
isSemiColonSeparated, expressionContainsNamed, name, nameLoop,
value, arg, expand;
value, arg, expand, hasSep = true;
parserInput.save();
@@ -953,7 +953,7 @@ var Parser = function Parser(context, imports, fileInfo) {
arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true);
}
if (!arg) {
if (!arg || !hasSep) {
break;
}
@@ -1019,10 +1019,12 @@ var Parser = function Parser(context, imports, fileInfo) {
argsComma.push({ name:nameLoop, value:value, expand:expand });
if (parserInput.$char(',')) {
hasSep = true;
continue;
}
hasSep = parserInput.$char(';') === ';';
if (parserInput.$char(';') || isSemiColonSeparated) {
if (hasSep || isSemiColonSeparated) {
if (expressionContainsNamed) {
error('Cannot mix ; and , as delimiter types');

View File

@@ -0,0 +1,7 @@
.non-matching-mixin(@a @b) {
args: @a @b;
}
x {
.non-matching-mixin(x, y);
}

View File

@@ -0,0 +1,4 @@
RuntimeError: No matching definition was found for `.non-matching-mixin(x, y)` in {path}mixin-not-defined-2.less on line 6, column 3:
5 x {
6 .non-matching-mixin(x, y);
7 }