JSDOC/ScopeParser.js
authoralan <alan@alanfast.akbkhome.com>
Mon, 19 Apr 2010 07:00:21 +0000 (15:00 +0800)
committeralan <alan@alanfast.akbkhome.com>
Mon, 19 Apr 2010 07:00:21 +0000 (15:00 +0800)
JSDOC/ScopeParser.js

index fa905f8..ff63b76 100644 (file)
@@ -364,13 +364,43 @@ ScopeParser.prototype = {
                         //println("<i>"+token.data+"</i>");
                         break;
                     }
+                    
+                     if (this.mode == 'CHECKING_SYMBOL_TREE') {
+                        
+                        //println("GOT IDENT: -2 : " + this.ts.lookT(-2).toString() + " <BR> ..... -1 :  " +  this.ts.lookT(-1).toString() + " <BR> "); 
+                        
+                        
+                        
+                        //println("GOT IDENT: <B>" + symbol + "</B><BR/>");
+                             
+                            //println("GOT IDENT (2): <B>" + symbol + "</B><BR/>");
+                        identifier = this.getIdentifier(symbol, scope);
+                        
+                        if (identifier == false) {
+// BUG!find out where builtin is defined...
+                            if (symbol.length <= 3 &&  Scope.builtin.indexOf(symbol) < 0) {
+                                // Here, we found an undeclared and un-namespaced symbol that is
+                                // 3 characters or less in length. Declare it in the global scope.
+                                // We don't need to declare longer symbols since they won't cause
+                                // any conflict with other munged symbols.
+                                this.globalScope.declareIdentifier(symbol, token);
+                                this.warn("Found an undeclared symbol: " + symbol, true);
+                            }
+                            
+                            //println("GOT IDENT IGNORE(3): <B>" + symbol + "</B><BR/>");
+                        } else {
+                            token.identifier = identifier;
+                            identifier.refcount++;
+                        }
+                    }   
+                    
                     break;
                     //println("<B>SID</B>");
                 default:
                     if (token.type != 'KEYW') {
                         break;
                     }
-                    print("Check eval:");
+                   // print("Check eval:");
                 
                     symbol = token.data;
                     
@@ -402,34 +432,6 @@ ScopeParser.prototype = {
 
                         }
 
-                    } else   if (this.mode == 'CHECKING_SYMBOL_TREE') {
-                        
-                        //println("GOT IDENT: -2 : " + this.ts.lookT(-2).toString() + " <BR> ..... -1 :  " +  this.ts.lookT(-1).toString() + " <BR> "); 
-                        
-                        
-                        
-                        //println("GOT IDENT: <B>" + symbol + "</B><BR/>");
-                             
-                            //println("GOT IDENT (2): <B>" + symbol + "</B><BR/>");
-                        identifier = this.getIdentifier(symbol, scope);
-                        
-                        if (identifier == false) {
-// BUG!find out where builtin is defined...
-                            if (symbol.length <= 3 &&  Scope.builtin.indexOf(symbol) < 0) {
-                                // Here, we found an undeclared and un-namespaced symbol that is
-                                // 3 characters or less in length. Declare it in the global scope.
-                                // We don't need to declare longer symbols since they won't cause
-                                // any conflict with other munged symbols.
-                                this.globalScope.declareIdentifier(symbol, token);
-                                this.warn("Found an undeclared symbol: " + symbol, true);
-                            }
-                            
-                            //println("GOT IDENT IGNORE(3): <B>" + symbol + "</B><BR/>");
-                        } else {
-                            token.identifier = identifier;
-                            identifier.refcount++;
-                        }
-                       
                     }
                     break;