sync
authorAlan Knowles <alan@akbkhome.com>
Tue, 10 Aug 2010 10:06:26 +0000 (18:06 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 10 Aug 2010 10:06:26 +0000 (18:06 +0800)
JSDOC/Collapse.js
JSDOC/Packer.js
JSDOC/TokenStream.js

index 62b3a73..71a89fd 100644 (file)
@@ -194,6 +194,12 @@ Collapse = XObject.define(
                     g.push(ar[i]);
                     continue;
                 }
+                // var a=..., b =...
+                if ((ar[i].data != ';') && g.length && (g[0].name == "VAR")) {;
+                    g.push(ar[i]);
+                    continue;
+                }
+                
                 g.push(ar[i]);
                 ret.push(g);
                 g = [];
index f7a3246..22a3757 100644 (file)
@@ -94,7 +94,7 @@ Packer = function(cfg)
         var outname = this.module ? this.module : GLib.path_get_basename(dirname);
         this.target = dirname + '/compiled/' + outname + '-' + version + '.js';
          if (File.exists(this.target)) {
-            print("Target file already exists");
+            print("Target file already exists: " + this.target);
             Seed.quit();
         }
         this.prefix = dirname +'/';
@@ -338,6 +338,8 @@ Packer.prototype = {
             }
             
         }
+        print("Output file: " + this.target);
+        if (this.debugTarget) print("Output debug file: " + this.debugTarget);
         
          
     
@@ -360,7 +362,8 @@ Packer.prototype = {
             keepWhite : true,  
             keepComments : true, 
             sepIdents : true,
-            collapseWhite : false
+            collapseWhite : false,
+            filename : fn
         });
         this.timerPrint("START" + fn);
         
@@ -396,6 +399,7 @@ Packer.prototype = {
         
         var out = CompressWhite(new TokenStream(toks), this, this.keepWhite); // do not kill whitespace..
         
+        
         this.timerPrint("Compressed");
         return out;
         
index 7b3328f..aee0b5a 100644 (file)
@@ -114,7 +114,10 @@ TokenStream = XObject.define(
                // print(i);
                 if (i < 0) {
                     if (n > -1) {
-                        i = 0; continue;
+                        i = 0; 
+                        count++;
+                        continue;
+                        
                     }
                     return   new Token("", "VOID", "END_OF_STREAM");
                 }