mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
do not chunk inside parens so that we can predict mixin calls containing detached rulesets. Also now save the current chunk (may not be required).
This commit is contained in:
@@ -45,6 +45,7 @@ less.Parser = function Parser(env) {
|
||||
j, // current chunk
|
||||
temp, // temporarily holds a chunk's state, for backtracking
|
||||
memo, // temporarily holds `i`, when backtracking
|
||||
memoChunk, // `j`
|
||||
furthest, // furthest index the parser has gone to
|
||||
chunks, // chunkified input
|
||||
current, // current chunk
|
||||
@@ -111,8 +112,8 @@ less.Parser = function Parser(env) {
|
||||
}
|
||||
};
|
||||
|
||||
function save() { temp = current; memo = currentPos = i; }
|
||||
function restore() { current = temp; currentPos = i = memo; }
|
||||
function save() { temp = current; memo = currentPos = i; memoChunk = j; }
|
||||
function restore() { current = temp; currentPos = i = memo; j = memoChunk; }
|
||||
|
||||
function sync() {
|
||||
if (i > currentPos) {
|
||||
@@ -424,7 +425,7 @@ less.Parser = function Parser(env) {
|
||||
if (--level < 0) {
|
||||
return fail("missing opening `{`");
|
||||
}
|
||||
if (!level) { emitChunk(); }
|
||||
if (!level && !parenLevel) { emitChunk(); }
|
||||
continue;
|
||||
case 92: // \
|
||||
if (parserCurrentIndex < len - 1) { parserCurrentIndex++; continue; }
|
||||
|
||||
Reference in New Issue
Block a user