JSDOC/Packer.vala
[gnome.introspection-doc-generator] / JSDOC / TokenStream.vala
index ad1baf2..dff38f4 100644 (file)
@@ -235,8 +235,8 @@ namespace JSDOC {
                    //Seed.print("STOP:" + stop);
                    Token token;
                    
-                   while (null != (token = this.lookTok(1))) {
-                               debug("BALANCE: " + token.asString());
+                   while (null != (token = this.look(1,false))) {
+                               debug("BALANCE: %d %s " , this.cursor,  token.asString());
                        if (token.is(start)) {
                      //      Seed.print("balance: START : " + depth + " " + token.data);
                            depth++;
@@ -249,12 +249,16 @@ namespace JSDOC {
                        
                        if (token.is(stop)) {
                            depth--;
-                       //    Seed.print("balance: STOP: "  + depth + " " + token.data);
+                           
+                               print("balance (%d): STOP: %s\n" ,  depth ,  token.data);
                            if (depth < 1) {
+                                   this.next(); // shift cursor to eat closer...
+                                       print("returning got %d\n", got.size);
                                        return got;
                                }
+                               
                        }
-                       if (null == this.nextTok()) {
+                       if (null == this.next()) {
                                break;
                        }
                    }