X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=JSDOC%2FCompressWhite.js;h=a51072294bcafd7e6617d74e8138dd99f876f6f1;hp=9ff469b0e88b96342a5406365aa80d3c49958d4c;hb=03fa54679334a30c2f5d70662aa9cb8b76964826;hpb=c1024b4b5c81d08f82dfbac13c002d0fd1bff7a6 diff --git a/JSDOC/CompressWhite.js b/JSDOC/CompressWhite.js index 9ff469b..a510722 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,14 +156,14 @@ CompressWhite = function (ts, packer) var cu = ts.cursor; if (!ts.balance("{") ){ - ts.dump(cu-40, cu+1); + ts.dump(cu-40, cu); print(">>>>>>>>>>>>>>>>>HERE>>>>>>>>>>>>"); - ts.dump(cu+1, cu+40); + 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 +";"; } @@ -149,6 +173,8 @@ CompressWhite = function (ts, packer) } // any more?? + // a = function(....) { } + }