X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=JSDOC%2FPacker.js;h=dde208516007d2ae72fb541999c82f3a23f76135;hp=d04e630e9061afb5682f12eace8e6e37e9c44503;hb=db7f0739d8000a3a6acadd881d562ced33a16a3b;hpb=7e8cb2a063f2c13985ea84ea4dbc7a0202a5428b diff --git a/JSDOC/Packer.js b/JSDOC/Packer.js index d04e630..dde2085 100644 --- a/JSDOC/Packer.js +++ b/JSDOC/Packer.js @@ -2,11 +2,12 @@ XObject = imports.XObject.XObject; File = imports.File.File; -TextStream = imports['JSDOC/TextStream.js'].TextStream; -TokenReader = imports['JSDOC/TokenReader.js'].TokenReader; -ScopeParser = imports['JSDOC/ScopeParser.js'].ScopeParser; -TokenStream = imports['JSDOC/TokenStream.js'].TokenStream; -CompressWhite = imports['JSDOC/CompressWhite.js'].CompressWhite; +TextStream = imports.TextStream.TextStream; +TokenReader = imports.TokenReader.TokenReader; +ScopeParser = imports.ScopeParser.ScopeParser; +TokenStream = imports.TokenStream.TokenStream; +CompressWhite = imports.CompressWhite.CompressWhite; +Collapse = imports.Collapse.Collapse; GLib = imports.gi.GLib; /** @@ -310,7 +311,13 @@ Packer.prototype = { pack : function (str,fn,minfile) { - var tr = new TokenReader( { keepDocs :true, keepWhite : true, keepComments : true, sepIdents : true }); + var tr = new TokenReader( { + keepDocs :true, + keepWhite : true, + keepComments : true, + sepIdents : true, + collapseWhite : false + }); this.timerPrint("START" + fn); // we can load translation map here... @@ -328,8 +335,12 @@ Packer.prototype = { // and replace if we are generating a different language.. this.timerPrint("Tokenized"); + //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(new TokenStream(toks)); + var sp = new ScopeParser(ts); this.timerPrint("Converted to Parser"); sp.packer = this; sp.buildSymbolTree(); @@ -337,7 +348,10 @@ Packer.prototype = { sp.mungeSymboltree(); this.timerPrint("Munged Sym tree"); print(sp.warnings.join("\n")); - var out = CompressWhite(sp.ts, this); + + + //var out = CompressWhite(new TokenStream(toks), this, true); // do not kill whitespace.. + var out = CompressWhite(new TokenStream(toks), this, false); this.timerPrint("Compressed"); return out;