Fix comments test

This commit is contained in:
Luke Page
2013-02-02 16:53:03 +00:00
parent e21bf1d7a1
commit a490bc12bf
3 changed files with 9 additions and 2 deletions

View File

@@ -832,6 +832,7 @@ less.Parser = function Parser(env) {
expressions = [];
while (arg = $(this.expression)) {
nameLoop = null;
arg.throwAwayComments();
value = arg;
// Variable
@@ -1470,7 +1471,8 @@ less.Parser = function Parser(env) {
while (e = $(this.addition) || $(this.entity)) {
entities.push(e);
if (!peek(/^\/\*/) && (delim = $('/'))) {
// operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here
if (!peek(/^\/[\/*]/) && (delim = $('/'))) {
entities.push(new(tree.Anonymous)(delim));
}
}

View File

@@ -29,6 +29,11 @@ tree.Expression.prototype = {
return this.value.map(function (e) {
return e.toCSS ? e.toCSS(env) : '';
}).join(' ');
},
throwAwayComments: function () {
this.value = this.value.filter(function(v) {
return !(v instanceof tree.Comment);
});
}
};

View File

@@ -58,7 +58,7 @@
.selector /* .with */, .lots, /* of */ .comments {
color: grey, /* blue */ orange;
-webkit-border-radius: 2px /* webkit only */;
-moz-border-radius: 2px * 4 /* moz only with operation */;
-moz-border-radius: (2px * 4) /* moz only with operation */;
}
.mixin_def_with_colors(@a: white, // in