sync
[gnome.introspection-doc-generator] / JSDOC / Collapse.js
index 8b47161..71a89fd 100644 (file)
@@ -88,7 +88,7 @@ Collapse = XObject.define(
                   //  Seed.print(TokenStream.toString(ret));
                     return ret;
                 }
-                 console.log(tok.data);
+                // console.log(tok.data);
                 switch(tok.type) {
                     case "VOID": 
                         return ret; //EOF
@@ -194,6 +194,12 @@ Collapse = XObject.define(
                     g.push(ar[i]);
                     continue;
                 }
+                // var a=..., b =...
+                if ((ar[i].data != ';') && g.length && (g[0].name == "VAR")) {;
+                    g.push(ar[i]);
+                    continue;
+                }
+                
                 g.push(ar[i]);
                 ret.push(g);
                 g = [];
@@ -239,8 +245,9 @@ Collapse = XObject.define(
                    
                 }
             }
-             // last..
-            if (k.length) {
+             // last.. - if g.val.length is 0 then it's a trailing ','...
+             // we should really throw a syntax error in that case..
+            if (k.length && g.val.length) {
                 ret[k] = g;
             }
             return ret;