mirror of
https://github.com/less/less.js.git
synced 2026-01-20 20:58:07 -05:00
basic comments parsing in mixin arguments. comments need more work and a general solution though. fixes #1071
This commit is contained in:
@@ -924,6 +924,7 @@ less.Parser = function Parser(env) {
|
||||
name = match[1];
|
||||
|
||||
do {
|
||||
$(this.comment);
|
||||
if (input.charAt(i) === '.' && $(/^\.{3}/)) {
|
||||
variadic = true;
|
||||
params.push({ variadic: true });
|
||||
@@ -956,6 +957,8 @@ less.Parser = function Parser(env) {
|
||||
furthest = i;
|
||||
restore();
|
||||
}
|
||||
|
||||
$(this.comment);
|
||||
|
||||
if ($(/^when/)) { // Guard
|
||||
cond = expect(this.conditions, 'expected condition');
|
||||
@@ -1390,7 +1393,7 @@ less.Parser = function Parser(env) {
|
||||
multiplication: function () {
|
||||
var m, a, op, operation;
|
||||
if (m = $(this.operand)) {
|
||||
while (!peek(/^\/\*/) && (op = ($('/') || $('*'))) && (a = $(this.operand))) {
|
||||
while (!peek(/^\/[*\/]/) && (op = ($('/') || $('*'))) && (a = $(this.operand))) {
|
||||
operation = new(tree.Operation)(op, [operation || m, a]);
|
||||
}
|
||||
return operation || m;
|
||||
|
||||
@@ -51,6 +51,9 @@
|
||||
-webkit-border-radius: 2px /* webkit only */;
|
||||
-moz-border-radius: 8px /* moz only with operation */;
|
||||
}
|
||||
.test {
|
||||
color: 1px //put in @b - causes problems! --->;
|
||||
}
|
||||
#last {
|
||||
color: #0000ff;
|
||||
}
|
||||
|
||||
@@ -61,5 +61,15 @@
|
||||
-moz-border-radius: 2px * 4 /* moz only with operation */;
|
||||
}
|
||||
|
||||
.mixin_def_with_colors(@a: white, // in
|
||||
@b: 1px //put in @b - causes problems! --->
|
||||
) // the
|
||||
when (@a = white) {
|
||||
.test {
|
||||
color: @b;
|
||||
}
|
||||
}
|
||||
.mixin_def_with_colors();
|
||||
|
||||
#last { color: blue }
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user