From: Alan Knowles Date: Thu, 15 Jul 2010 08:52:27 +0000 (+0800) Subject: JSDOC/ScopeParser.js X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=commitdiff_plain;h=632b7ff2d420baf9dd4a77edb7a714a5c8040fa4;hp=cb2da9518e730711ccc64faa231429106c7c5564 JSDOC/ScopeParser.js --- diff --git a/JSDOC/ScopeParser.js b/JSDOC/ScopeParser.js index a7abc9c..b77f6ee 100644 --- a/JSDOC/ScopeParser.js +++ b/JSDOC/ScopeParser.js @@ -277,7 +277,7 @@ ScopeParser.prototype = { if (this.mode == "BUILDING_SYMBOL_TREE") { - identifier = thisScope.getIdentifier(token.data) ; + identifier = thisScope.getIdentifier(token.data,token) ; if (identifier == false) { thisScope.declareIdentifier(token.data, token); @@ -485,7 +485,7 @@ ScopeParser.prototype = { //println("GOT IDENT: " + symbol + "
"); //println("GOT IDENT (2): " + symbol + "
"); - identifier = this.getIdentifier(symbol, thisScope); + identifier = this.getIdentifier(symbol, thisScope, token); if (identifier == false) { // BUG!find out where builtin is defined... @@ -525,7 +525,7 @@ ScopeParser.prototype = { var _t = this; this.ts.look(-1).data.replace(/eval:var:([a-z_]+)/ig, function(m, a) { - var hi = _t.getIdentifier(a, thisScope); + var hi = _t.getIdentifier(a, thisScope, token); // println("PROTECT "+a+" from munge" + (hi ? "FOUND" : "MISSING")); if (hi) { // println("PROTECT "+a+" from munge"); @@ -717,7 +717,7 @@ ScopeParser.prototype = { if (this.mode == 'PASS2_SYMBOL_TREE') { - identifier = this.getIdentifier(symbol, currentScope); + identifier = this.getIdentifier(symbol, currentScope, token); //println("??"); if (identifier == false) { @@ -767,7 +767,7 @@ ScopeParser.prototype = { // look for eval:var:noreplace\n var _t = this; this.ts.look(-1).data.replace(/eval:var:([a-z]+)/ig, function(m, a) { - var hi = _t.getIdentifier(a, currentScope); + var hi = _t.getIdentifier(a, currentScope, token); //println("PROTECT "+a+" from munge" + (hi ? "FOUND" : "MISSING")); if (hi) { // println("PROTECT "+a+" from munge"); @@ -822,7 +822,7 @@ ScopeParser.prototype = { currentScope.declareIdentifier(symbol, token); } else { //?? why inc the refcount?? - that should be set when building the tree??? - identifier = this.getIdentifier(symbol, currentScope); + identifier = this.getIdentifier(symbol, currentScope, token); identifier.refcount++; } @@ -848,7 +848,7 @@ ScopeParser.prototype = { if (this.mode == 'BUILDING_SYMBOL_TREE') { // Get the name of the function and declare it in the current scope. symbol = token.data; - if (currentScope.getIdentifier(symbol) != false) { + if (currentScope.getIdentifier(symbol,token) != false) { this.warn("The function " + symbol + " has already been declared in the same scope...", true); } currentScope.declareIdentifier(symbol,token); @@ -937,10 +937,10 @@ ScopeParser.prototype = { scope.preventMunging(); }, - getIdentifier: function(symbol, scope) { + getIdentifier: function(symbol, scope, token) { var identifier; while (scope != false) { - identifier = scope.getIdentifier(symbol); + identifier = scope.getIdentifier(symbol, token); //println("ScopeParser.getIdentgetUsedSymbols("+symbol+")=" + scope.getUsedSymbols().join(',')); if (identifier) { return identifier;