X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FScopeParser.vala;h=c705f4a50c952de1199e2651c0c1938558e381c4;hb=7ce7b063dc2e6940bd0a9baec9adc91b5cd25d0b;hp=38e73ab4e32a46ed3cdaede83298bd7bc132dcd8;hpb=1af418ba813cad5cec2da102647cab7ccebafc36;p=gnome.introspection-doc-generator diff --git a/JSDOC/ScopeParser.vala b/JSDOC/ScopeParser.vala index 38e73ab..c705f4a 100644 --- a/JSDOC/ScopeParser.vala +++ b/JSDOC/ScopeParser.vala @@ -901,8 +901,8 @@ namespace JSDOC { //assert token.getType() == Token.NAME || // token.getType() == Token.COMMA; if (token.type == "NAME" && this.mode == ScopeParserMode.BUILDING_SYMBOL_TREE) { - symbol = token.data; - identifier = fnScope.declareIdentifier(symbol,token); + var symbol = token.data; + var identifier = fnScope.declareIdentifier(symbol,token); if (symbol == "$super" && argpos == 0) { // Exception for Prototype 1.6... identifier.preventMunging(); @@ -921,11 +921,9 @@ namespace JSDOC { //token = this.ts.nextTok(); //print(token.toString()); var outTS = this.ts; - var _this = this; - token.items.forEach(function(tar) { - _this.ts = new TokenStream(tar); - _this.parseScope(fnScope); - + foreach(var tar in token.items) { + this.ts = new TokenStream(tar); + this.parseScope(fnScope); }); @@ -938,9 +936,9 @@ namespace JSDOC { //print("ENDFN -1: " + this.ts.lookTok(-1).toString()); //print("ENDFN 0: " + this.ts.lookTok(0).toString()); //print("ENDFN 1: " + this.ts.lookTok(1).toString()); - }, + } - protectScopeFromObfuscation : function(scope) { + void protectScopeFromObfuscation (scope) { //assert scope != null; if (scope == this.globalScope) { @@ -956,18 +954,20 @@ namespace JSDOC { //assert scope.getParentScope() == globalScope; scope.preventMunging(); - }, + } - getIdentifier: function(symbol, scope, token) { - var identifier; - while (scope != false) { + string getIdentifier(string symbol, Scope in_scope, Token token) + { + string identifier; + var scope = in_scope; + while (scope != null) { identifier = scope.getIdentifier(symbol, token); //println("ScopeParser.getIdentgetUsedSymbols("+symbol+")=" + scope.getUsedSymbols().join(',')); - if (identifier) { + if (identifier.length) { return identifier; } scope = scope.parent; } - return false; + return ""; } -}; +}