JSDOC/CompressWhite.vala
[gnome.introspection-doc-generator] / JSDOC / CompressWhite.vala
index ca8aa78..fe1479f 100644 (file)
@@ -78,12 +78,11 @@ namespace JSDOC
                                //println("got = function() ");
                                tok = ts.next();
                                tok = ts.next();
-                               tok = ts.next();
+                               //tok = ts.next();
 
                                var cu = ts.cursor;
-                               ts.cursor+=2; // move two along, and balance...
-                               
-                               if (tok.data != "(" || ts.balance("(").size < 1 ){
+                                 
+                               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);
@@ -92,10 +91,14 @@ namespace JSDOC
                                    
                                    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>>>>>>>>>>>>");