JSDOC/ScopeParser.js
[gnome.introspection-doc-generator] / JSDOC / ScopeParser.js
index d93f771..b9a7d1f 100644 (file)
@@ -225,10 +225,10 @@ ScopeParser.prototype = {
         var isInObjectLitAr;
         this.scopes.push(scope);
        
-        var scopeIndent = ''; 
-        this.scopes.forEach(function() {
-            scopeIndent += '   '; 
-        });
+        //var scopeIndent = ''; 
+        //this.scopes.forEach(function() {
+        //    scopeIndent += '   '; 
+        //});
         //print(scopeIndent + ">> ENTER SCOPE");
         
         
@@ -321,8 +321,31 @@ ScopeParser.prototype = {
                     break;
 
                 case "PUNC.LEFT_CURLY": // {
-                    print('SCOPE-CURLY:' + token.toString());
+                    print('SCOPE-CURLY:' + JSON.stringify(token,null,4));
                     //println("<i>"+token.data+"</i>");
+                    
+                    if (token.props) {
+                        var curTS = this.ts;
+                        for (var prop in token.props) {
+                            if (token.props[prop].val.data == 'function') {
+                                // parse a function..
+                                this.parseFunctProp(token.props[prop]);
+                                continue;
+                            }
+                            // key value..
+                            
+                            this.ts = new TokenStream(token.props[prop].val);
+                            this.parseScope(scope);
+                            
+                            
+                        }
+                        this.ts = curTS;
+                        
+                        // it's an object literal..
+                        // the values could be replaced..
+                        
+                    }
+                    
                     isObjectLitAr.push(false);
                     this.braceNesting++;
                     
@@ -381,6 +404,7 @@ ScopeParser.prototype = {
                 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();