@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) {
var out = '';
var outoff = 0;
- out.length = ts.slen; // prealloc.
+ try { out.length = ts.slen; } catch (e) {} // prealloc.
+
out = '';
var tok;
while (true) {
if (!tok) {
break;
}
- if (tok.name == "COMM") {
- tok.outData == '\n';
+ if (tok.type == "COMM") {
+ 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;
}