mirror of
https://github.com/less/less.js.git
synced 2026-01-20 20:58:07 -05:00
multi comments in selectors and other places
This commit is contained in:
@@ -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))) {
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
*/
|
||||
/* @group Variables
|
||||
------------------- */
|
||||
#comments {
|
||||
#comments,
|
||||
.comments {
|
||||
/**/
|
||||
color: red;
|
||||
/* A C-style comment */
|
||||
|
||||
@@ -34,7 +34,13 @@
|
||||
|
||||
/* @group Variables
|
||||
------------------- */
|
||||
#comments /* boo */ {
|
||||
#comments /* boo *//* boo again*/,
|
||||
//.commented_out1
|
||||
//.commented_out2
|
||||
//.commented_out3
|
||||
.comments //end of comments1
|
||||
//end of comments2
|
||||
{
|
||||
/**/ // An empty comment
|
||||
color: red; /* A C-style comment */ /* A C-style comment */
|
||||
background-color: orange; // A little comment
|
||||
|
||||
Reference in New Issue
Block a user