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

index 6a84a10..1c38b44 100644 (file)
@@ -178,7 +178,9 @@ ScopeParser.prototype = {
 
     log : function(str)
     {
-          //println("<B>LOG:</B>" + htmlescape(str) + "<BR/>\n");
+        print ("                    ".substring(0, this.braceNesting) + str);
+        
+        //println("<B>LOG:</B>" + htmlescape(str) + "<BR/>\n");
     },
     logR : function(str)
     {
@@ -210,9 +212,9 @@ ScopeParser.prototype = {
         while (token) {
           //  this.timerPrint("parseScope AFTER lookT: " + token.toString()); 
              
-            !this.debug|| print(token.type + '.' + token.name+ ":" + token.data);
+            this.log(token.type + '.' + token.name+ ":" + token.data);
             if (token.type == 'NAME') {
-                print('*' + token.data);
+            //    print('*' + token.data);
             }
             switch(token.type + '.' + token.name) {
                 case "KEYW.VAR":
@@ -284,20 +286,20 @@ ScopeParser.prototype = {
                     isObjectLitAr.push(false);
                     this.braceNesting++;
                     
-                    print(">>>>>> OBJLIT PUSH(false)" + this.braceNesting);
+                    //print(">>>>>> OBJLIT PUSH(false)" + this.braceNesting);
                     break;
 
                 case "PUNC.RIGHT_CURLY": // }
                     //println("<i>"+token.data+"</i>");
                     this.braceNesting--;
                     isObjectLitAr.pop();
-                    print(">>>>>> OBJLIT POP"+ this.braceNesting);
+                    //print(">>>>>> OBJLIT POP"+ this.braceNesting);
                         //assert braceNesting >= scope.getBra ceNesting();
                     
                     if (this.braceNesting < 0) {
                         var ls = this.scopes.pop();
                         ls.getUsedSymbols();
-                        print("<<<<<<<EXIT SCOPE" +this.scopes.length);
+                        //print("<<<<<<<EXIT SCOPE" +this.scopes.length);
                         return;
                     }
                     break;
@@ -335,7 +337,7 @@ ScopeParser.prototype = {
                         // then we are in an object lit.. -> we need to flag the brace as such...
                         isObjectLitAr.pop();
                         isObjectLitAr.push(true);
-                        print(">>>>>> OBJLIT REPUSH(true)");
+                        //print(">>>>>> OBJLIT REPUSH(true)");
                     }
                     isInObjectLitAr = isObjectLitAr[isObjectLitAr.length-1];
                     
@@ -366,7 +368,7 @@ ScopeParser.prototype = {
                     if ((this.ts.lookTok(-1).data == "{") && (this.ts.lookTok(1).data == ":")) {
                         isObjectLitAr.pop();
                         isObjectLitAr.push(true);
-                        print(">>>>>> OBJLIT REPUSH(true)");
+                        //print(">>>>>> OBJLIT REPUSH(true)");
                         //println("<i>"+token.data+"</i>");
                         break;
                     }
@@ -516,13 +518,13 @@ ScopeParser.prototype = {
                             isObjectLitAr.push(false);
                             
                             this.braceNesting++;
-                            print(">>>>> EXP PUSH(false)"+this.braceNesting);
+                            ///print(">>>>> EXP PUSH(false)"+this.braceNesting);
                             break;
 
                         case '}': //Token.RC:
                             this.braceNesting--;
                             isObjectLitAr.pop();
-                            print(">>>>> EXP POP" + this.braceNesting);    
+                            //print(">>>>> EXP POP" + this.braceNesting);    
                            // assert braceNesting >= expressionBraceNesting;
                             break;
 
@@ -549,7 +551,7 @@ ScopeParser.prototype = {
                         // then we are in an object lit.. -> we need to flag the brace as such...
                         isObjectLitAr.pop();
                         isObjectLitAr.push(true);
-                        print(">>>>> EXP PUSH(true)");
+                        //print(">>>>> EXP PUSH(true)");
                     }
                     
                     
@@ -579,7 +581,7 @@ ScopeParser.prototype = {
                         // then we are in an object lit.. -> we need to flag the brace as such...
                         isObjectLitAr.pop();
                         isObjectLitAr.push(true);
-                         print(">>>>> EXP  PUSH(true)");
+                         //print(">>>>> EXP  PUSH(true)");
                         break;
                     }
                     isInObjectLitAr = isObjectLitAr[isObjectLitAr.length-1];