X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FCompressWhite.vala;h=aadac2617dc3dbb1a6d8a8b33043e07f18d6a5d0;hb=4874ad3e1d08502e88986231f3de271795ca2302;hp=a0317550e5c52ff70e28b2e8461a819189a54fb3;hpb=ffcce32d10dd8ced8f47a12160bcdb74d8f611eb;p=gnome.introspection-doc-generator diff --git a/JSDOC/CompressWhite.vala b/JSDOC/CompressWhite.vala index a031755..aadac26 100644 --- a/JSDOC/CompressWhite.vala +++ b/JSDOC/CompressWhite.vala @@ -71,27 +71,34 @@ namespace JSDOC ts.cursor = cu; continue; } - // a = function() { ... + // a = function() { ... -- add a semi colon a tthe end if not one there.. if (ts.lookTok(1).data == "=" && ts.lookTok(2).name == "FUNCTION") { // freeze time.. //println("got = function() "); + tok = ts.next(); + tok = ts.next(); + //tok = ts.next(); + var cu = ts.cursor; - ts.cursor+=2; // move two along, and balance... - - if (ts.balance("(").size < 1 ){ + + if (tok.data != "(" || ts.balance("(").size < 1 ){ - print("balance ( issue on line %d\n", ts.look(0).line); + print("balance ( issue on line %d\n", ts.toArray().get(cu).line); ts.dump(cu-40, cu+2); print(">>>>>>>>>>>>>>>>>HERE>>>>>>>>>>>>"); ts.dump(cu+2, cu+40); throw new CompressWhiteError.BRACE( "could not find end lbrace!!!" ); } + tok = ts.lookTok(0); + + cu = ts.cursor; // set the cursor to here.. so the next bit of the code will check inside the method. + //print("AFTER BALANCE ("); //ts.dump(cu, ts.cursor); //ts.cursor--; // cursor at the ( - if (ts.balance("{").size < 1 ){ + if (tok.data != "{" || ts.balance("{").size < 1 ){ ts.dump(cu-40, cu); print(">>>>>>>>>>>>>>>>>HERE>>>>>>>>>>>>");