JSDOC/ScopeParser.js
authorAlan Knowles <alan@akbkhome.com>
Thu, 15 Jul 2010 03:31:13 +0000 (11:31 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 15 Jul 2010 03:31:13 +0000 (11:31 +0800)
JSDOC/ScopeParser.js

index 859f440..f779d8d 100644 (file)
@@ -208,17 +208,12 @@ ScopeParser.prototype = {
         var isObjectLitAr = [ false ];
         var isInObjectLitAr;
         this.scopes.push(scope);
-        
-        // for printing stuff..
-        var scopeIndent = ''; 
-        this.scopes.forEach(function() {
-            scopeIndent += '   '; 
-        });
+       
         
         token = this.ts.lookTok(1);
         while (token) {
           //  this.timerPrint("parseScope AFTER lookT: " + token.toString()); 
-             print(scopeIndent + 'OBJLIT.len='+ isObjectLitAr.length + ' ' + token.toString());
+             //print(scopeIndent + 'OBJLIT.len='+ isObjectLitAr.length + ' ' + token.toString());
             //this.log(token.data);
             if (token.type == 'NAME') {
             //    print('*' + token.data);
@@ -495,6 +490,12 @@ ScopeParser.prototype = {
         // Parse functions if any...
         //println("<i>EXP</i><BR/>");
         !this.debug || print("PARSE EXPR");
+        
+         
+        // for printing stuff..
+       
+        
+        
         var symbol;
         var token;
         var currentScope;
@@ -511,6 +512,13 @@ ScopeParser.prototype = {
             
             currentScope = this.scopes[this.scopes.length-1];
             
+            var scopeIndent = ''; 
+            this.scopes.forEach(function() {
+                scopeIndent += '   '; 
+            });
+            
+            print(scopeIndent + 'OBJLIT.len='+ isObjectLitAr.length + ' ' + token.toString());
+            
             //println("<i>"+token.data+"</i>");
             //this.log("EXP:" + token.data);
             switch (token.type) {
@@ -592,9 +600,9 @@ ScopeParser.prototype = {
                 case 'NAME':
                
                     symbol = token.data;
-                    print("in NAME = " + token.toString());
-                    print("in NAME 0: " + this.ts.look(0).toString());
-                    print("in NAME 2: " + this.ts.lookTok(2).toString());
+                    //print("in NAME = " + token.toString());
+                    //print("in NAME 0: " + this.ts.look(0).toString());
+                    //print("in NAME 2: " + this.ts.lookTok(2).toString());
                     if (this.ts.look(0).data == "{"  && this.ts.lookTok(2).data == ":") {
                         // then we are in an object lit.. -> we need to flag the brace as such...
                         isObjectLitAr.pop();
@@ -604,7 +612,7 @@ ScopeParser.prototype = {
                     }
                     
                     isInObjectLitAr = isObjectLitAr[isObjectLitAr.length-1];
-                    print ("isInObjectLitAr : " + isInObjectLitAr + ' ' + token.toString());
+                    //print ("isInObjectLitAr : " + isInObjectLitAr + ' ' + token.toString());
                     
                     if (isInObjectLitAr && this.ts.lookTok(0).data == "," && this.ts.lookTok(2).data == ":") {
                         break;