X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=JSDOC%2FCompressWhite.vala;h=053713ceea4f35a946547c280bd1095da2825921;hp=781042850bcd4ffa6be9264f80fb0dd8e95f9499;hb=HEAD;hpb=b41176f5d4becc16b6df43eb764f37de3bec3cc4 diff --git a/JSDOC/CompressWhite.vala b/JSDOC/CompressWhite.vala index 7810428..053713c 100644 --- a/JSDOC/CompressWhite.vala +++ b/JSDOC/CompressWhite.vala @@ -17,6 +17,8 @@ namespace JSDOC { //keepWhite = keepWhite || false; ts.rewind(); + //ts.dumpAllFlat(); GLib.Process.exit(1); + //var str = File.read(fn); var rep_var = 1; @@ -71,27 +73,39 @@ 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; - ts.cursor+=2; // move two along, and balance... - - if (ts.balance("(").size < 1 ){ + tok = ts.nextTok(); + tok = ts.nextTok(); - print("balance ( issue on line %d\n", ts.lookTok(0).line); + //tok = ts.next(); + var cu = ts.cursor; + //print("NEXT = should be brac: %s\n", ts.lookTok(1).asString()); + + //print("cursor = %d", ts.cursor); + + 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+2, cu+40); throw new CompressWhiteError.BRACE( "could not find end lbrace!!!" ); } + //print("cursor = %d", ts.cursor); + //print("CUR = should be ): %s\n", ts.lookTok(0).asString()); + + tok = ts.nextTok(); + //print("CUR = should be {: %s\n", ts.lookTok(0).asString()); + cu = ts.cursor; // set the cursor to here.. so the next bit of the code will check inside the method. + //print("cursor = %d", ts.cursor); //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>>>>>>>>>>>>");