X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=JSDOC%2FCompressWhite.js;h=13d6df7d2ffb93c497dcbad5cc57e86ee2abeac4;hp=1698649c5109d21a0afaf3dd216e90004590dcd6;hb=6534df3589197eabe11704e9f7a18cff965898f2;hpb=4798a0d56fd9a8912713de2edfe435bf9575223b diff --git a/JSDOC/CompressWhite.js b/JSDOC/CompressWhite.js index 1698649..13d6df7 100644 --- a/JSDOC/CompressWhite.js +++ b/JSDOC/CompressWhite.js @@ -8,9 +8,9 @@ @arg packer {Packer} */ -CompressWhite = function (ts, packer) +CompressWhite = function (ts, packer, keepWhite) { - + keepWhite = keepWhite || false; ts.rewind(); //var str = File.read(fn); var rep_var = 1; @@ -21,6 +21,7 @@ CompressWhite = function (ts, packer) break; } if (tok.type == "WHIT") { + continue; //if (tok._isDoc) { // continue; @@ -79,7 +80,7 @@ CompressWhite = function (ts, packer) throw "could not find end lbrace!!!"; } //print("AFTER BALANCE ("); - ts.dump(cu, ts.cursor); + //ts.dump(cu, ts.cursor); //ts.cursor--; // cursor at the ( if (!ts.balance("{") ){ ts.dump(cu-40, cu); @@ -270,13 +271,17 @@ CompressWhite = function (ts, packer) var outoff = 0; out.length = ts.slen; // prealloc. out = ''; + var tok; while (true) { - var tok = ts.nextTok(); - + + tok = keepWhite ? ts.next() : ts.nextTok(); + if (!tok) { break; } - + if (tok.name == "COMM") { + tok.outData == '\n'; + } if (tok.type == "NAME" && tok.identifier && tok.identifier.mungedValue && tok.identifier.mungedValue.length) { //f.write(tok.identifier.mungedValue);