multi comments in selectors and other places

This commit is contained in:
Luke Page
2013-03-20 08:51:47 +00:00
parent 6fc6dc2301
commit f068d2da68
3 changed files with 23 additions and 6 deletions

View File

@@ -577,6 +577,16 @@ less.Parser = function Parser(env) {
}
},
comments: function () {
var comment, comments = [];
while(comment = $(this.comment)) {
comments.push(comment);
}
return comments;
},
//
// Entities are tokens which can be found inside an Expression
//
@@ -893,7 +903,7 @@ less.Parser = function Parser(env) {
if (isCall) {
arg = $(this.expression);
} else {
$(this.comment);
$(this.comments);
if (input.charAt(i) === '.' && $(/^\.{3}/)) {
returner.variadic = true;
if ($(";") && !isSemiColonSeperated) {
@@ -1023,7 +1033,7 @@ less.Parser = function Parser(env) {
restore();
}
$(this.comment);
$(this.comments);
if ($(/^when/)) { // Guard
cond = expect(this.conditions, 'expected condition');
@@ -1199,9 +1209,9 @@ less.Parser = function Parser(env) {
while (s = $(this.selector)) {
selectors.push(s);
$(this.comment);
$(this.comments);
if (! $(',')) { break }
$(this.comment);
$(this.comments);
}
if (selectors.length > 0 && (rules = $(this.block))) {