JSDOC/ScopeNamer.js
authorAlan Knowles <alan@roojs.com>
Wed, 9 Nov 2011 08:32:23 +0000 (16:32 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 9 Nov 2011 08:32:23 +0000 (16:32 +0800)
JSDOC/ScopeNamer.js

index 1ebd297..274a00f 100644 (file)
@@ -94,6 +94,10 @@ ScopeNamer = XObject.define(
     imports.JSDOC.Collapse.Collapse, 
     {
         
+        debugCall : function(str)  {
+            print(str);
+        },
+        
         collapseTop : true,
         
         buildSymbols : function()
@@ -104,7 +108,7 @@ ScopeNamer = XObject.define(
             }
             
             //this.globalScope(this.statements);
-            print("build Symbols");
+            this.debugCall("build Symbols");
             //print (this.statements);
             //print (JSON.stringify(this.statements, null,2));
            
@@ -162,7 +166,7 @@ ScopeNamer = XObject.define(
                 return false;
             }
             
-             print("ADD:" + scope + ' => ' + r);
+            print("ADD:" + scope + ' => ' + r);
             //print("CANON:"  + r);
             
             return r;
@@ -202,7 +206,7 @@ ScopeNamer = XObject.define(
         
         walkStatements: function(scope, statements)
         {
-            print("walkStatements :" + scope ) ;            
+            this.debugCall("walkStatements :" + scope ) ;            
             var _this = this;
             var res = false;
             
@@ -220,7 +224,7 @@ ScopeNamer = XObject.define(
         {
             this.tokens = stmt;
             this.rewind();
-            print("walkStatement :" + scope + '@' + this.tokens[0].line );
+            this.debugCall("walkStatement :" + scope + '@' + this.tokens[0].line );
              
             var name;
             var sn;
@@ -302,7 +306,7 @@ ScopeNamer = XObject.define(
         
         walkFunctionDef : function (inscope, name, args, stmts, jsdocTok)
         {
-            print("wallkFuncDef: " + inscope + '@' + this.look(0).line );
+            this.debugCall("wallkFuncDef: " + inscope + '@' + this.look(0).line );
             var scope = inscope + '.' + name;
             
             
@@ -318,7 +322,7 @@ ScopeNamer = XObject.define(
         
         walkCall : function (inscope, assign, callname, items, jsdocTok)
         {
-            print("wallkCall : " + inscope + '@' + this.look(0).line );
+            this.debugCall("wallkCall : " + inscope + '@' + this.look(0).line );
             var scope = inscope + ( assign ? ('.' + assign) : '' );
             scope = scope.replace(/\^$global\$\./, '');
             
@@ -381,7 +385,7 @@ ScopeNamer = XObject.define(
                  
             }
             
-            print("wallkObject : " + scope);
+            this.debugCall("wallkObject : " + scope);
             for( var k in items) {
                 var key = items[k].key;
                 var val = items[k].val;