X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FCompressWhite.vala;h=dffe4f2a520e87e97c0609b6c81ccfb5336b24c6;hb=47d710e1ad8352be849a59e4728f421627e568a6;hp=daa2c57a1958eb07eddff3403a087271923967f7;hpb=d9212b730d63f4fc0e8f4a41d965e1bd2cf7ef2a;p=gnome.introspection-doc-generator diff --git a/JSDOC/CompressWhite.vala b/JSDOC/CompressWhite.vala index daa2c57..dffe4f2 100644 --- a/JSDOC/CompressWhite.vala +++ b/JSDOC/CompressWhite.vala @@ -13,7 +13,7 @@ namespace JSDOC BRACE } - public string CompressWhite (TokenStream ts, Packer packer, bool keepWhite) throws CompressWhiteError,TokenStreamError + public string CompressWhite (TokenStream ts, Packer packer, bool keepWhite) // throws CompressWhiteError,TokenStreamError { //keepWhite = keepWhite || false; ts.rewind(); @@ -71,24 +71,37 @@ 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() "); - var cu = ts.cursor; - - if (ts.balance("(").size < 1 ){ - ts.dump(cu-40, cu); + tok = ts.nextTok(); + tok = ts.nextTok(); + + //tok = ts.next(); + var cu = ts.cursor; + print("NEXT = should be brac: %s\n", ts.lookTok(1).asString()); + + + + if (ts.lookTok(1).data != "(" || ts.balance("(").size < 1 ){ + print("balance ( issue on line %d\n", ts.toArray().get(cu).line); + ts.dump(cu-40, cu+2); print(">>>>>>>>>>>>>>>>>HERE>>>>>>>>>>>>"); - ts.dump(cu, cu+40); + 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>>>>>>>>>>>>"); ts.dump(cu, cu+40); @@ -163,6 +176,7 @@ namespace JSDOC var cu = ts.cursor; if (ts.balance("{").size < 1 ){ + ts.dump(cu-40, cu); print(">>>>>>>>>>>>>>>>>HERE>>>>>>>>>>>>"); ts.dump(cu, cu+40);