X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FCompressWhite.js;h=50d7476e10984fdd2a4d6bfb8af89db6e7ce894d;hb=35ddfbdfc0fb33aab65d6722db3948ca210ede7f;hp=e284e80e4e208c1ea0b5fe7a71ea57f5aba4c588;hpb=f9a049fa33bddc22fb087239a7b832f1cc4491ca;p=gnome.introspection-doc-generator diff --git a/JSDOC/CompressWhite.js b/JSDOC/CompressWhite.js index e284e80..50d7476 100644 --- a/JSDOC/CompressWhite.js +++ b/JSDOC/CompressWhite.js @@ -8,13 +8,15 @@ @arg packer {Packer} */ -CompressWhite = function (ts, packer, keepWhite) +const CompressWhite = function (ts, packer, keepWhite) { keepWhite = keepWhite || false; ts.rewind(); //var str = File.read(fn); var rep_var = 1; + + while (true) { var tok = ts.next(); if (!tok) { @@ -269,7 +271,8 @@ CompressWhite = function (ts, packer, keepWhite) var out = ''; var outoff = 0; - out.length = ts.slen; // prealloc. + try { out.length = ts.slen; } catch (e) {} // prealloc. + out = ''; var tok; while (true) { @@ -280,11 +283,15 @@ CompressWhite = function (ts, packer, keepWhite) break; } if (tok.type == "COMM") { - tok.outData == '\n'; + tok.outData = '\n'; } - if (tok.type == "NAME" && tok.identifier && tok.identifier.mungedValue && tok.identifier.mungedValue.length) { + ///print(tok.type + ':' + tok.data); + + if (tok.type == "NAME" && tok.identifier + && tok.identifier.mungedValue && tok.identifier.mungedValue.length) { //f.write(tok.identifier.mungedValue); + //print("MUNGED: " + tok.identifier.mungedValue); out += tok.identifier.mungedValue; continue; }