JSDOC/BuildDocs.js
[gnome.introspection-doc-generator] / JSDOC / BuildDocs.js
index c696db7..d11416a 100644 (file)
@@ -12,7 +12,7 @@ Template = imports.JsTemplate.Template.Template;
 
 
 Parser   = imports.Parser.Parser;
-
+TextStream = imports.TextStream.TextStream;
 TokenReader = imports.TokenReader.TokenReader;
 TokenStream = imports.TokenStream.TokenStream;
 Symbol = imports.Symbol.Symbol;
@@ -21,7 +21,7 @@ Symbol = imports.Symbol.Symbol;
 // should not realy be here -- or anywhere...??
 
 
-Options = false;
+Options = false; // refer to this everywhere!
 
 
 BuildDocs = {
@@ -40,7 +40,7 @@ BuildDocs = {
         Options.LOG.inform("JsDoc Toolkit main() running at "+new Date()+".");
         //Options.LOG.inform("With options: ");
         
-        if (!File.isDirectory(Options.cacheDirectory)) {   
+        if (Options.cacheDirectory.length && !File.isDirectory(Options.cacheDirectory)) {   
             File.mkdir(Options.cacheDirectory)
         }
         
@@ -122,6 +122,7 @@ BuildDocs = {
             
             var src = ''
             try {
+                Options.LOG.warn("reading : " + srcFile);
                 src = File.read(srcFile);
             }
             catch(e) {
@@ -129,9 +130,10 @@ BuildDocs = {
                 continue;
             }
 
-             
-            var tr = new TokenReader();
-            var ts = new TokenStream(tr.tokenize(src));
+            var txs = new TextStream(src);
+            
+            var tr = new TokenReader({ keepComments : true, keepWhite : true });
+            var ts = new TokenStream(txs);
         
             Parser.parse(ts, srcFile);