JSDOC/ScopeParser.js
[gnome.introspection-doc-generator] / JSDOC / ScopeParser.js
index 2199ef0..784faa9 100644 (file)
@@ -1,7 +1,7 @@
 //<Script type="text/javascript">
 
-Scope = imports['JSDOC/Scope.js'].Scope;
-
+Scope = imports.Scope.Scope;
+TokenStream = imports.TokenStream.TokenStream;
 /**
 * Scope stuff
 * 
@@ -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");
         
         
@@ -313,7 +313,7 @@ ScopeParser.prototype = {
                     
                     break;
                 case "KEYW.FUNCTION":
-                    print('SCOPE-FUNC:' + token.toString());
+                    print('SCOPE-FUNC:' + JSON.stringify(token,null,4));
                     //println("<i>"+token.data+"</i>");
                      var bn = this.braceNesting;
                     this.parseFunctionDeclaration();
@@ -321,13 +321,31 @@ ScopeParser.prototype = {
                     break;
 
                 case "PUNC.LEFT_CURLY": // {
-                    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..
+                        
                     }
+                    print('SCOPE-CURLY:' + JSON.stringify(token,null,4));
+                    print("NOT PROPS"); Seed.quit();
                     
                     isObjectLitAr.push(false);
                     this.braceNesting++;
@@ -834,6 +852,7 @@ ScopeParser.prototype = {
           
         }
         
+        print('FUNC-PARSE:' + JSON.stringify(token,null,4));
         // Parse function arguments.
         var argpos = 0;
         while (this.ts.lookTok().data != ')') { //(token = consumeToken()).getType() != Token.RP) {