[Pkg-javascript-commits] [less.js] 41/88: 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).

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:22:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v1.7.0
in repository less.js.

commit ed0e13a0ecd2f2bb31d2874c61d351c54803245d
Author: Luke Page <luke.a.page at gmail.com>
Date:   Wed Feb 12 22:34:58 2014 +0000

    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).
---
 lib/less/parser.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/less/parser.js b/lib/less/parser.js
index 064e5f2..fc3c1fe 100644
--- a/lib/less/parser.js
+++ b/lib/less/parser.js
@@ -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; }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list