Update Packer code to working copy
[gnome.introspection-doc-generator] / JSDOC / Scope.js
index aa145c3..2161c97 100644 (file)
@@ -24,7 +24,7 @@ function Scope(braceN, parent, startTokN, lastIdent, token)
     this.hints = { };
     this.ident = lastIdent;
     this.gid = Scope.gid++;
-    
+    this.token = token;
     //print("ADD SCOPE(" + this.gid + ") TO "+ (parent ? this.parent.gid : 'TOP') + ' : ' + 
     //    (token ? token.toString() : ''));
     
@@ -53,7 +53,29 @@ Scope.prototype = {
     
     munged : false,
     protectedVars : {}, // only used by to parent..
-    declareIdentifier : function(symbol, token) {
+    
+    /**
+     * dump the scope to StdOut...
+     * 
+     */
+    dump : function(indent) 
+    {
+        indent = indent || '';
+        print(
+            indent +  "Scope: " + this.id + "\n" +
+            indent + "Started: " + ( this.token ? this.token.line  : 'TOP' ) + "\n" +
+            indent + "- " + XObject.keys(this.identifiers).join(", ") + "\n"
+        );
+        this.subScopes.forEach(function(s) {
+            s.dump(indent + ' ');
+        });
+        
+        
+    },
+    
+    
+    declareIdentifier : function(symbol, token) 
+    {
         
         //print("SCOPE : " + this.gid +  " :SYM: " + symbol + " " + token.toString()+"");