X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FScopeParser.js;h=42e36c50031a89b1514c19e159d76aacfa16d1cb;hb=d31a393414c1bfead2da1209739d2a122fa3dd24;hp=a4944d6bd20457ab6afccb71281e62338c513fa4;hpb=bb6445f69b6c3bc5dba127f1327619ff8d06edb4;p=gnome.introspection-doc-generator diff --git a/JSDOC/ScopeParser.js b/JSDOC/ScopeParser.js index a4944d6..42e36c5 100644 --- a/JSDOC/ScopeParser.js +++ b/JSDOC/ScopeParser.js @@ -141,7 +141,7 @@ ScopeParser.prototype = { this.braceNesting = 0; this.scopes = []; - + print(JSON.stringify(this.ts.tokens, null,4)); this.globalScope = new Scope(-1, false, -1, ''); @@ -258,7 +258,7 @@ ScopeParser.prototype = { while (true) { token = this.ts.nextTok(); //!this.debug|| print( token.toString()); - //print('SCOPE-VAR-VAL:' + token.toString()); + print('SCOPE-VAR-VAL:' + JSON.stringify(token, null, 4)); if (!token) { // can return false at EOF! break; } @@ -300,7 +300,23 @@ ScopeParser.prototype = { } else { //var bn = this.braceNesting; var bn = this.braceNesting; - this.parseExpression(); + var nts = []; + while (true) { + var n = this.ts.lookTok(); + print(n.toString()); + if (!n || n.type == 'VOID' || n.data == ',') { + break; + } + nts.push(n); + this.ts.nextTok(); + } + if (nts.length) { + var TS = this.ts; + this.ts = new TokenStream(nts); + this.parseExpression(); + this.ts = TS; + } + this.braceNesting = bn; //this.braceNesting = bn; //this.logR("parseScope DONE : ParseExpression - tok is:" + this.ts.lookT(0).toString()); @@ -880,7 +896,7 @@ ScopeParser.prototype = { 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++) {