JSDOC/Packer.vala
[gnome.introspection-doc-generator] / JSDOC / Packer.vala
index 8da314a..20ffa76 100644 (file)
@@ -344,79 +344,79 @@ namespace JSDOC
                
                
                }
-    /**
-     * Core packing routine  for a file
-     * 
-     * @param str - str source text..
-     * @param fn - filename (for reference?)
-     * @param minfile - min file location...
-     * 
-     */
-    
-    void packFile  (string str,string fn, string minfile)
-    {
-    
-               var tr = new  TokenReader();
-               tr.keepDocs =true;
-               tr.keepWhite = true;
-               tr.keepComments = true;
-               tr.sepIdents = true;
-               tr.collapseWhite = false;
-               tr.filename = fn;
+               /**
+                * Core packing routine  for a file
+                * 
+                * @param str - str source text..
+                * @param fn - filename (for reference?)
+                * @param minfile - min file location...
+                * 
+                */
 
-        this.timerPrint("START" + fn);
-        
-        // we can load translation map here...
-        
-        var toks = tr.tokenize(new TextStream(str)); // dont merge xxx + . + yyyy etc.
-        
-        
-        
-        this.activeFile = fn;
-        
-        // and replace if we are generating a different language..
-        
-        //var ts = new TokenStream(toks);
-        //print(JSON.stringify(toks, null,4 )); Seed.quit();
-        var ts = new Collapse(toks);
-       // print(JSON.stringify(ts.tokens, null,4 )); Seed.quit();
-        //return;//
-        var sp = new ScopeParser(ts);
-        sp.packer = this;
-        sp.buildSymbolTree();
-        sp.mungeSymboltree();
-        print(sp.warnings.join("\n"));
-        
-        var out = CompressWhite(new TokenStream(toks), this, this.keepWhite); // do not kill whitespace..
-        
-        
-        
-        
-         if (out.length) {
-            File.write(minfile, out);
-             
-        }
-        
-        return out;
-        
-        
-         
-    },
-     
-    
-    md5 : function (string)
-    {
-        
-        return GLib.compute_checksum_for_string(GLib.ChecksumType.MD5, string, string.length);
-        
-    },
-    
-    //stringHandler : function(tok) -- not used...
+               private string packFile  (string str,string fn, string minfile)
+               {
+
+                       var tr = new  TokenReader();
+                       tr.keepDocs =true;
+                       tr.keepWhite = true;
+                       tr.keepComments = true;
+                       tr.sepIdents = true;
+                       tr.collapseWhite = false;
+                       tr.filename = fn;
+
+                       this.timerPrint("START" + fn);
+               
+                       // we can load translation map here...
+               
+                       var toks = tr.tokenize(new TextStream(str)); // dont merge xxx + . + yyyy etc.
+               
+               
+               
+                       this.activeFile = fn;
+               
+                       // and replace if we are generating a different language..
+               
+
+                       //var ts = new TokenStream(toks);
+                       //print(JSON.stringify(toks, null,4 )); Seed.quit();
+                       var ts = new Collapse(toks);
+                  // print(JSON.stringify(ts.tokens, null,4 )); Seed.quit();
+                       //return;//
+                       var sp = new ScopeParser(ts);
+
+                       sp.packer = this;
+                       sp.buildSymbolTree();
+
+                       sp.mungeSymboltree();
+
+                       print(sp.warnings.join("\n"));
+
+               
+                       var out = CompressWhite(new TokenStream(toks), this, this.keepWhite); // do not kill whitespace..
+               
+               
+               
+               
+                        if (out.length > 0) {
+                               FileUtils.put_contents(minfile, out);
+                                
+                       }
+               
+                       return out;
+               
+               
+                        
+               }
+                
+
+               public string md5(string str)
+               {
+               
+                       return GLib.compute_checksum_for_string(GLib.ChecksumType.MD5, str);
+               
+               }
     
+        //stringHandler : function(tok) -- not used...
+    }
     
-};
+}