mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
Fix comment chunking. Fixes #1082
This commit is contained in:
@@ -309,7 +309,7 @@ less.Parser = function Parser(env) {
|
||||
chunk = chunks[0],
|
||||
inParam;
|
||||
|
||||
for (var i = 0, c, cc; i < input.length; i++) {
|
||||
for (var i = 0, c, cc; i < input.length;) {
|
||||
skip.lastIndex = i;
|
||||
if (match = skip.exec(input)) {
|
||||
if (match.index === i) {
|
||||
@@ -324,7 +324,7 @@ less.Parser = function Parser(env) {
|
||||
if (match.index === i) {
|
||||
i += match[0].length;
|
||||
chunk.push(match[0]);
|
||||
c = input.charAt(i);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ less.Parser = function Parser(env) {
|
||||
if (match.index === i) {
|
||||
i += match[0].length;
|
||||
chunk.push(match[0]);
|
||||
c = input.charAt(i);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -348,6 +348,8 @@ less.Parser = function Parser(env) {
|
||||
case ')': if ( inParam) { inParam = false; chunk.push(c); break }
|
||||
default: chunk.push(c);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
if (level != 0) {
|
||||
error = new(LessError)({
|
||||
|
||||
@@ -57,3 +57,7 @@
|
||||
#last {
|
||||
color: #0000ff;
|
||||
}
|
||||
/* *//* { *//* *//* *//* */#div {
|
||||
color: #A33;
|
||||
}
|
||||
/* } */
|
||||
|
||||
@@ -73,3 +73,5 @@
|
||||
|
||||
#last { color: blue }
|
||||
//
|
||||
|
||||
/* *//* { *//* *//* *//* */#div { color:#A33; }/* } */
|
||||
|
||||
Reference in New Issue
Block a user