X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FBuildDocs.js;h=d11416a1cbd79c963d2f44866b166d5964b44692;hb=f01cf79c67addcf90ef57a17911e45e2d6746a05;hp=153ad48cbbbb6671104c5385954e68f741e105ad;hpb=f9b3d38484fc770701ffd663a0bef7d7e5de441c;p=gnome.introspection-doc-generator diff --git a/JSDOC/BuildDocs.js b/JSDOC/BuildDocs.js index 153ad48..d11416a 100644 --- a/JSDOC/BuildDocs.js +++ b/JSDOC/BuildDocs.js @@ -10,9 +10,9 @@ File = imports.File.File; Template = imports.JsTemplate.Template.Template; -Options = imports.Options.Options; -Parser = imports.Parser.Parser; +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; // refer to this everywhere! BuildDocs = { @@ -31,15 +31,16 @@ BuildDocs = { srcFiles : [], - build : function () + + build : function (opts) { - + Options = opts; Options.init(); 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) } @@ -121,6 +122,7 @@ BuildDocs = { var src = '' try { + Options.LOG.warn("reading : " + srcFile); src = File.read(srcFile); } catch(e) { @@ -128,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); @@ -276,7 +279,7 @@ BuildDocs = { }, - publishJSON = function(file, data) + publishJSON : function(file, data) { // what we need to output to be usefull... // a) props..