JSDOC/CompressWhite.js
[gnome.introspection-doc-generator] / JSDOC / CompressWhite.js
index 5c7ffec..13d6df7 100644 (file)
@@ -21,9 +21,7 @@ CompressWhite =  function (ts, packer, keepWhite)
             break;
         }
         if (tok.type == "WHIT") {
-            if (keepWhite) {
-                ts.look(0).outData = ts.look(0).data;
-               }
+           
             continue;
             //if (tok._isDoc) {
             //    continue;
@@ -273,13 +271,17 @@ CompressWhite =  function (ts, packer, keepWhite)
     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);