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:
Luke Page
2014-02-12 22:34:58 +00:00
parent 7f26515630
commit ed0e13a0ec

View File

@@ -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; }