JSDOC/ScopeParser.js
[gnome.introspection-doc-generator] / JSDOC / ScopeParser.js
index 03291fd..6922034 100644 (file)
@@ -201,11 +201,11 @@ ScopeParser.prototype = {
         var isObjectLitAr = [ false ];
         
         this.scopes.push(scope);
-        token = this.ts.lookTok();
+        token = this.ts.lookTok(1);
         while (token) {
           //  this.timerPrint("parseScope AFTER lookT: " + token.toString()); 
              
-            //println("START<i>"+token.data+"</i>");
+            print(token.type + '.' + token.name+ ":" + token.data);
             switch(token.type + '.' + token.name) {
                 case "KEYW.VAR":
                 case "KEYW.CONST": // not really relivant as it's only mozzy that does this.
@@ -245,7 +245,7 @@ ScopeParser.prototype = {
                                 token.getType() == Token.COMMA ||
                                 token.getType() == Token.IN;
                         */
-                        if (token.name == "IN")) {
+                        if (token.name == "IN") {
                             break;
                         } else {
                             this.parseExpression();
@@ -337,9 +337,10 @@ ScopeParser.prototype = {
                 
                 
                 default: 
-                    if ((token.type != "NAME") && (token.type != "KEYW"){
+                    if ((token.type != "NAME") && (token.type != "KEYW")){
                         break;
                     }
+                    print("DEAL WITH NAME:");
                     // got identifier..
                     
                     // look for  { ** : <- indicates obj literal.. ** this could occur with numbers ..
@@ -349,6 +350,7 @@ ScopeParser.prototype = {
                         //println("<i>"+token.data+"</i>");
                         break;
                     }
+                    print("DEAL WITH obj lit:");
                     var isInObjectLitAr = isObjectLitAr[isObjectLitAr.length-1];
                     
                     if (isInObjectLitAr && (this.ts.lookTok(1).data == ":") && (this.ts.lookTok(-1).data == ",")) {
@@ -359,8 +361,8 @@ ScopeParser.prototype = {
                     
                     
                     // skip anyting with "." before it..!!
-                    
-                    if (this.ts.lookTok(-1).data(".")) {
+                     
+                    if (this.ts.lookTok(-1).data == ".") {
                         // skip, it's an object prop.
                         //println("<i>"+token.data+"</i>");
                         break;
@@ -368,7 +370,7 @@ ScopeParser.prototype = {
                     
                     //println("<B>SID</B>");
                    
-                
+                    print("Check eval:");
                 
                     symbol = token.data;
                     
@@ -523,7 +525,7 @@ ScopeParser.prototype = {
                     
                      
                     var isInObjectLitAr = isObjectLitAr[isObjectLitAr.length-1];
-                    if (isInObjectLitAr &&  this.ts.lookTok(1).data = ":"  &&
+                    if (isInObjectLitAr &&  this.ts.lookTok(1).data == ":"  &&
                         ( this.ts.lookTok(-1).data == "{"  ||  this.ts.lookTok(-1).data == "," )) {
                         // see if we can replace..
                         // remove the quotes..
@@ -807,4 +809,4 @@ ScopeParser.prototype = {
         }
         return false;
     }
-});
\ No newline at end of file
+};
\ No newline at end of file