diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js index 0a5f14ad..83346b3c 100644 --- a/lib/less/parser/parser.js +++ b/lib/less/parser/parser.js @@ -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'); diff --git a/test/less/errors/mixin-not-defined-2.less b/test/less/errors/mixin-not-defined-2.less new file mode 100644 index 00000000..867f81c0 --- /dev/null +++ b/test/less/errors/mixin-not-defined-2.less @@ -0,0 +1,7 @@ +.non-matching-mixin(@a @b) { + args: @a @b; +} + +x { + .non-matching-mixin(x, y); +} \ No newline at end of file diff --git a/test/less/errors/mixin-not-defined-2.txt b/test/less/errors/mixin-not-defined-2.txt new file mode 100644 index 00000000..2d1ad850 --- /dev/null +++ b/test/less/errors/mixin-not-defined-2.txt @@ -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 }