JSDOC/ScopeParser.js
authorAlan Knowles <alan@akbkhome.com>
Thu, 15 Jul 2010 07:00:33 +0000 (15:00 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 15 Jul 2010 07:00:33 +0000 (15:00 +0800)
JSDOC/ScopeParser.js

index b3a3a4b..72cf11d 100644 (file)
@@ -627,34 +627,49 @@ ScopeParser.prototype = {
                             break;
 
                        
-
+                        case '(': //Token.LP:
                         case '{': //Token.LC:
-                            isObjectLitAr.push(false);
+                        case '[': //Token.LB:
+                            print('SCOPE-CURLY/PAREN/BRACE:' + token.toString());
+                            //println("<i>"+token.data+"</i>");
+                            var curTS = this.ts;
+                            if (token.props) {
+                                
+                                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..
+                                break;
+                            }
                             
-                            this.braceNesting++;
+                            
+                            var _this = this;
+                            token.items.forEach(function(expr) {
+                                  _this.ts = new TokenStream(expr);
+                                  _this.parseExpression(scope)
+                            });
+                            this.ts = curTS;
+                        
+                        
+                    
                             ///print(">>>>> EXP PUSH(false)"+this.braceNesting);
                             break;
 
-                        case '}': //Token.RC:
-                            this.braceNesting--;
-                            isObjectLitAr.pop();
-                            //print(">>>>> EXP POP" + this.braceNesting);    
-                           // assert braceNesting >= expressionBraceNesting;
-                            break;
-
-                        case '[': //Token.LB:
+                       
                         
-                            var ts = this.ts;
-                            var _this = this;
-                            token.items.forEach(function(ns) {
-                                 print("EXPR-PUNC-MAKE:" + JSON.stringify(ns, null, 4));
-                                _this.ts = new TokenStream(ns);
-                                //_this.ts.cursor--;
-                                _this.parseExpression();
-                            });
-                            this.ts = ts;
-                            
-                            break;
+                         
                             
                         case ')': //Token.RP:
                         case ']': //Token.RB:
@@ -663,13 +678,12 @@ ScopeParser.prototype = {
                             return;
                            
  
-                        case '(': //Token.LP:
+             
                             parensNesting++;
                             break;
 
                         
-                            parensNesting--;
-                            break;
+                            
                     }
                     break;