JSDOC/ScopeParser.js
[gnome.introspection-doc-generator] / JSDOC / ScopeParser.js
index eccc7a5..2199ef0 100644 (file)
@@ -238,7 +238,7 @@ ScopeParser.prototype = {
         while (token) {
           //  this.timerPrint("parseScope AFTER lookT: " + token.toString()); 
             //this.dumpToken(token , this.scopes, this.braceNesting);
-            print('SCOPE:' + token.toString());
+            //print('SCOPE:' + token.toString());
             //this.log(token.data);
             if (token.type == 'NAME') {
             //    print('*' + token.data);
@@ -246,7 +246,7 @@ ScopeParser.prototype = {
             switch(token.type + '.' + token.name) {
                 case "KEYW.VAR":
                 case "KEYW.CONST": // not really relivant as it's only mozzy that does this.
-                    
+                    print('SCOPE-VAR:' + token.toString());
                     var vstart = this.ts.cursor +1;
                     
                     //this.log("parseScope GOT VAR/CONST : " + token.toString()); 
@@ -313,6 +313,7 @@ ScopeParser.prototype = {
                     
                     break;
                 case "KEYW.FUNCTION":
+                    print('SCOPE-FUNC:' + token.toString());
                     //println("<i>"+token.data+"</i>");
                      var bn = this.braceNesting;
                     this.parseFunctionDeclaration();
@@ -320,13 +321,20 @@ ScopeParser.prototype = {
                     break;
 
                 case "PUNC.LEFT_CURLY": // {
+                    print('SCOPE-CURLY:' + JSON.stringify(token,null,4));
                     //println("<i>"+token.data+"</i>");
+                    
+                    if (token.props) {
+                        // it's an object literal..
+                        // the values could be replaced..
+                    }
+                    
                     isObjectLitAr.push(false);
                     this.braceNesting++;
                     
                     //print(">>>>>> OBJLIT PUSH(false)" + this.braceNesting);
                     break;
-
+/*
                 case "PUNC.RIGHT_CURLY": // }
                     //println("<i>"+token.data+"</i>");
                     this.braceNesting--;
@@ -346,8 +354,9 @@ ScopeParser.prototype = {
                         return;
                     }
                     break;
-
+*/
                 case "KEYW.WITH":
+                    print('SCOPE-WITH:' + token.toString());
                     //println("<i>"+token.data+"</i>");   
                     if (this.mode == "BUILDING_SYMBOL_TREE") {
                         // Inside a 'with' block, it is impossible to figure out
@@ -361,6 +370,7 @@ ScopeParser.prototype = {
                     break;
 
                 case "KEYW.CATCH":
+                    print('SCOPE-CATCH:' + token.toString());
                     //println("<i>"+token.data+"</i>");
                     this.parseCatch();
                     break;
@@ -375,7 +385,9 @@ ScopeParser.prototype = {
                 
                 case "STRN.DOUBLE_QUOTE": // used for object lit detection..
                 case "STRN.SINGLE_QUOTE":
+                    print('SCOPE-STRING:' + token.toString());
                     //println("<i>"+token.data+"</i>");
+
                     if (this.ts.lookTok(-1).data == '{' && this.ts.lookTok(1).data == ':') {
                         // then we are in an object lit.. -> we need to flag the brace as such...
                         isObjectLitAr.pop();
@@ -403,7 +415,7 @@ ScopeParser.prototype = {
                     break;
                 
                 case "NAME.NAME":
-                
+                    print('SCOPE-NAME:' + token.toString());
                     //print("DEAL WITH NAME:");
                     // got identifier..
                     
@@ -470,6 +482,7 @@ ScopeParser.prototype = {
                     if (token.type != 'KEYW') {
                         break;
                     }
+                    print('SCOPE-KEYW:' + token.toString());
                    // print("Check eval:");
                 
                     symbol = token.data;