X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FScopeParser.js;h=008eca1f59368206e2291f602a29a77b84d6b268;hb=3002a1f318fb7d0caa4641992fa6fc83a24b2386;hp=40b1e66963a9f2fea71f34e771484e6d6aa8664c;hpb=56b6177ba991706820b123ac0a3edf7d9c9b3ea8;p=gnome.introspection-doc-generator diff --git a/JSDOC/ScopeParser.js b/JSDOC/ScopeParser.js index 40b1e66..008eca1 100644 --- a/JSDOC/ScopeParser.js +++ b/JSDOC/ScopeParser.js @@ -521,10 +521,11 @@ ScopeParser.prototype = { if (symbol == "eval") { // look back one and see if we can find a comment!!! - if (this.ts.look(-1).type == "COMM") { + //if (this.ts.look(-1).type == "COMM") { + if (token.prefix && token.prefix.match('/eval/')) { // look for eval:var:noreplace\n var _t = this; - this.ts.look(-1).data.replace(/eval:var:([a-z_]+)/ig, function(m, a) { + token.prefix.replace(/eval:var:([a-z_]+)/ig, function(m, a) { var hi = _t.getIdentifier(a, thisScope, token); // println("PROTECT "+a+" from munge" + (hi ? "FOUND" : "MISSING")); @@ -628,7 +629,7 @@ ScopeParser.prototype = { case '(': //Token.LP: case '{': //Token.LC: case '[': //Token.LB: - print('SCOPE-CURLY/PAREN/BRACE:' + token.toString()); + //print('SCOPE-CURLY/PAREN/BRACE:' + token.toString()); // print('SCOPE-CURLY/PAREN/BRACE:' + JSON.stringify(token, null,4)); //println(""+token.data+""); var curTS = this.ts; @@ -767,10 +768,10 @@ ScopeParser.prototype = { if (this.mode == 'BUILDING_SYMBOL_TREE') { if (symbol == "eval") { - if (this.ts.look(-1).type == 'COMM') { + if (token.prefix && token.prefix.match('/eval/')) { // look for eval:var:noreplace\n var _t = this; - this.ts.look(-1).data.replace(/eval:var:([a-z]+)/ig, function(m, a) { + token.prefix.replace(/eval:var:([a-z]+)/ig, function(m, a) { var hi = _t.getIdentifier(a, currentScope, token); //println("PROTECT "+a+" from munge" + (hi ? "FOUND" : "MISSING")); if (hi) { @@ -859,6 +860,10 @@ ScopeParser.prototype = { } token = this.ts.nextTok(); } + // return function() {.... + if (token.name == "RETURN") { + token = this.ts.nextTok(); + } //assert token.getType() == Token.LP; if (this.mode == 'BUILDING_SYMBOL_TREE') { @@ -871,10 +876,9 @@ ScopeParser.prototype = { } else { //qln("FETCHING SCOPE" + this.ts.cursor); fnScope = this.indexedScopes[token.id]; - } //if (this.mode == 'BUILDING_SYMBOL_TREE') - // print('FUNC-PARSE:' + JSON.stringify(token,null,4)); + print('FUNC-PARSE:' + JSON.stringify(token,null,4)); // Parse function arguments. var args = token.items; for (var argpos =0; argpos < args.length; argpos++) {