X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=JSDOC%2FScope.js;h=ed5202af818616e088e98ecf4da81b287ab29744;hp=2161c97407cd53ec57d87a16f381a9c10a38e024;hb=15d8f50209e07792458b915a0ef44673b687930e;hpb=f6f4e4b544a8f20535fe9e8507a50ea695b1b4fe diff --git a/JSDOC/Scope.js b/JSDOC/Scope.js index 2161c97..ed5202a 100644 --- a/JSDOC/Scope.js +++ b/JSDOC/Scope.js @@ -6,9 +6,10 @@ * // FIXME - I need this to do next() without doccomments.. */ -Identifier = imports.Identifier.Identifier -XObject = imports.XObject.XObject; +const Identifier = imports.Identifier.Identifier +const XObject = imports.XObject.XObject; +Scope.id = 1; function Scope(braceN, parent, startTokN, lastIdent, token) { @@ -18,7 +19,7 @@ function Scope(braceN, parent, startTokN, lastIdent, token) this.braceN = braceN this.parent = parent; - this.id = startTokN; + this.id = Scope.id++; this.identifiers = { }; this.subScopes = []; this.hints = { }; @@ -61,10 +62,16 @@ Scope.prototype = { dump : function(indent) { indent = indent || ''; + var str = ''; + for (var k in this.identifiers) { + str += str.length ? ", " : ""; + str += k + '=>' + this.identifiers[k].mungedValue; + } + print( - indent + "Scope: " + this.id + "\n" + + indent + "Scope: " + this.id + "\n" + indent + "Started: " + ( this.token ? this.token.line : 'TOP' ) + "\n" + - indent + "- " + XObject.keys(this.identifiers).join(", ") + "\n" + indent + "- " + str + "\n" ); this.subScopes.forEach(function(s) { s.dump(indent + ' ');