JSDOC/CompressWhite.js
[gnome.introspection-doc-generator] / JSDOC / CompressWhite.js
index 3048b7f..8b04293 100644 (file)
@@ -32,7 +32,16 @@ CompressWhite =  function (ts, packer)
             
             
         }
-        
+        if (tok.data == "}")  {
+            
+            if (ts.lookTok(1).type == 'NAME' && ts.look(1,true).name == "NEWLINE") {
+            
+                ts.look(0).outData = ts.look(0).data+"\n";
+            }
+            // restore.. 
+            
+            continue;
+        }
         // add semi-colon's where linebreaks are used... - not foolproof yet.!
         if (tok.type == "NAME")  {
             //var tokident = ts.look(-1).data + tok.data + ts.look(1).data +  ts.look(2).data;
@@ -123,6 +132,10 @@ CompressWhite =  function (ts, packer)
                 var cu = ts.cursor;
                 
                 if (!ts.balance("{") ){
+                    ts.dump(cu-40, cu);
+                    print(">>>>>>>>>>>>>>>>>HERE>>>>>>>>>>>>");
+                    ts.dump(cu+1, cu+40);
+                    
                     throw "could not find end lbrace!!!";
                 }
                 // if next is not ';' -> make it so...