X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FCompressWhite.js;h=16210828cf2ff6dfee3c6448b3726d746195203e;hb=9905efb4c5b6bc5cefb535f85b41333c968d6a4d;hp=f7e2abb15497e91bb519dbb0247108172fbdc2a8;hpb=4a0156a0d4d93f4ffa6c7a2155115959e9a28ebe;p=gnome.introspection-doc-generator diff --git a/JSDOC/CompressWhite.js b/JSDOC/CompressWhite.js index f7e2abb..1621082 100644 --- a/JSDOC/CompressWhite.js +++ b/JSDOC/CompressWhite.js @@ -71,13 +71,37 @@ CompressWhite = function (ts, packer) //println("got = function() "); var cu = ts.cursor; - ts.balance("("); - ts.balance("{"); + if (!ts.balance("(") ){ + ts.dump(cu-40, cu); + print(">>>>>>>>>>>>>>>>>HERE>>>>>>>>>>>>"); + ts.dump(cu, cu+40); + + throw "could not find end lbrace!!!"; + } + print("AFTER BALANCE ("); + ts.dump(cu, ts.cursor+2); + + if (!ts.balance("{") ){ + ts.dump(cu-40, cu); + print(">>>>>>>>>>>>>>>>>HERE>>>>>>>>>>>>"); + ts.dump(cu, cu+40); + + throw "could not find end lbrace!!!"; + } + print('FN: '+ts.tokens[cu].toString()); + print('F1: '+ts.lookTok(1).toString()); + print('F2: '+ts.look(1,true).toString()); + // if next is not ';' -> make it so... // although this var a=function(){},v,c; causes - if (ts.lookTok(1).data != ';' && ts.lookTok(1).data != '}' && ts.lookTok(1,true).name == "NEWLINE") { + if (ts.lookTok(1).data != ';' && ts.lookTok(1).data != '}' && ts.look(1,true).name == "NEWLINE") { + ts.look(0).outData = ts.look(0).data+";"; + print("ADDING SEMI: " + ts.look(0).toString()); + //ts.dump(cu, ts.cursor+2); } + + ts.dump(cu, ts.cursor+2); // restore.. ts.cursor = cu; continue; @@ -132,11 +156,14 @@ CompressWhite = function (ts, packer) var cu = ts.cursor; if (!ts.balance("{") ){ - ts.dump(); + ts.dump(cu-40, cu); + print(">>>>>>>>>>>>>>>>>HERE>>>>>>>>>>>>"); + ts.dump(cu, cu+40); + throw "could not find end lbrace!!!"; } // if next is not ';' -> make it so... - + if (ts.lookTok(1).data != ';' && ts.lookTok(1).data != '}' && ts.look(1,true).name=="NEWLINE") { ts.look(0).outData = ts.look(0).data +";"; } @@ -146,6 +173,8 @@ CompressWhite = function (ts, packer) } // any more?? + // a = function(....) { } + }