projects
/
gnome.introspection-doc-generator
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JSDOC/ScopeParser.js
[gnome.introspection-doc-generator]
/
JSDOC
/
ScopeParser.js
diff --git
a/JSDOC/ScopeParser.js
b/JSDOC/ScopeParser.js
index
65d60f3
..
2914d18
100644
(file)
--- a/
JSDOC/ScopeParser.js
+++ b/
JSDOC/ScopeParser.js
@@
-141,7
+141,7
@@
ScopeParser.prototype = {
this.braceNesting = 0;
this.scopes = [];
this.braceNesting = 0;
this.scopes = [];
-
+ print(JSON.stringify(this.ts.tokens, null,4));
this.globalScope = new Scope(-1, false, -1, '');
this.globalScope = new Scope(-1, false, -1, '');
@@
-258,7
+258,7
@@
ScopeParser.prototype = {
while (true) {
token = this.ts.nextTok();
//!this.debug|| print( token.toString());
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;
}
if (!token) { // can return false at EOF!
break;
}
@@
-300,7
+300,23
@@
ScopeParser.prototype = {
} else {
//var bn = this.braceNesting;
var bn = this.braceNesting;
} 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.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 : <B>ParseExpression</B> - tok is:" + this.ts.lookT(0).toString());
this.braceNesting = bn;
//this.braceNesting = bn;
//this.logR("parseScope DONE : <B>ParseExpression</B> - tok is:" + this.ts.lookT(0).toString());
@@
-860,7
+876,13
@@
ScopeParser.prototype = {
}
token = this.ts.nextTok();
}
}
token = this.ts.nextTok();
}
-
+ // return function() {....
+ if (token.name == "RETURN") {
+ token = this.ts.nextTok();
+ }
+ if (token.name == "FUNCTION") {
+ token = this.ts.nextTok();
+ }
//assert token.getType() == Token.LP;
if (this.mode == 'BUILDING_SYMBOL_TREE') {
fnScope = new Scope(1, currentScope, token.n, '', token);
//assert token.getType() == Token.LP;
if (this.mode == 'BUILDING_SYMBOL_TREE') {
fnScope = new Scope(1, currentScope, token.n, '', token);
@@
-872,10
+894,9
@@
ScopeParser.prototype = {
} else {
//qln("FETCHING SCOPE" + this.ts.cursor);
fnScope = this.indexedScopes[token.id];
} else {
//qln("FETCHING SCOPE" + this.ts.cursor);
fnScope = this.indexedScopes[token.id];
-
}
//if (this.mode == 'BUILDING_SYMBOL_TREE')
}
//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++) {
// Parse function arguments.
var args = token.items;
for (var argpos =0; argpos < args.length; argpos++) {