X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FScopeParser.js;h=d515586748615901df5a0ebe752e48f8e68bca63;hb=0c1f4c84d2c895a915a71327ce0de52250b1e11d;hp=bdd9b3f550cbd83f412ae6e9cf474ec2b5d924bc;hpb=00b1e7d8c4b1531d117c2bbfc056342aa7d0a72f;p=gnome.introspection-doc-generator diff --git a/JSDOC/ScopeParser.js b/JSDOC/ScopeParser.js index bdd9b3f..d515586 100644 --- a/JSDOC/ScopeParser.js +++ b/JSDOC/ScopeParser.js @@ -321,11 +321,12 @@ ScopeParser.prototype = { break; case "PUNC.LEFT_CURLY": // { - + case "PUNC.LEFT_PAREN": // ( + print('SCOPE-CURLY/PAREN:' + token.toString()); //println(""+token.data+""); - + var curTS = this.ts; if (token.props) { - var curTS = this.ts; + for (var prop in token.props) { if (token.props[prop].val.data == 'function') { // parse a function.. @@ -342,18 +343,28 @@ ScopeParser.prototype = { // it's an object literal.. // the values could be replaced.. - + break; } - print('SCOPE-CURLY:' + JSON.stringify(token,null,4)); - print("NOT PROPS"); Seed.quit(); - isObjectLitAr.push(false); - this.braceNesting++; + + var _this = this; + token.items.forEach(function(expr) { + _this.ts = new TokenStream(expr); + _this.parseExpression(scope) + }); + this.ts = curTS; + //print("NOT PROPS"); Seed.quit(); + + //isObjectLitAr.push(false); + //this.braceNesting++; //print(">>>>>> OBJLIT PUSH(false)" + this.braceNesting); break; -/* + case "PUNC.RIGHT_CURLY": // } + print("<< EXIT SCOPE"); + return; + /* //println(""+token.data+""); this.braceNesting--; isObjectLitAr.pop(); @@ -545,6 +556,7 @@ ScopeParser.prototype = { //if (this.ts.nextT()) break; } + print("<<< EXIT SCOPE"); //print("<<<<<<"+token.data+""); + var curTS = this.ts; + if (token.props) { + + for (var prop in token.props) { + if (token.props[prop].val.data == 'function') { + // parse a function.. + this.parseFunctProp(token.props[prop]); + continue; + } + // key value.. + + this.ts = new TokenStream(token.props[prop].val); + this.parseScope(currentScope); + + } + this.ts = curTS; + + // it's an object literal.. + // the values could be replaced.. + break; + } - this.braceNesting++; + + var _this = this; + token.items.forEach(function(expr) { + _this.ts = new TokenStream(expr); + _this.parseExpression() + }); + this.ts = curTS; + + + ///print(">>>>> EXP PUSH(false)"+this.braceNesting); break; - case '}': //Token.RC: - this.braceNesting--; - isObjectLitAr.pop(); - //print(">>>>> EXP POP" + this.braceNesting); - // assert braceNesting >= expressionBraceNesting; - break; - - case '[': //Token.LB: + - var ts = this.ts; - var _this = this; - token.items.forEach(function(ns) { - print("EXPR-PUNC-MAKE:" + JSON.stringify(ns, null, 4)); - _this.ts = new TokenStream(ns); - _this.ts.cursor--; - _this.parseExpression(); - }); - this.ts = ts; + - break; -/* + case ')': //Token.RP: case ']': //Token.RB: - bracketNesting--; - break; -*/ - case '(': //Token.LP: + case '}': //Token.RB: + print("<< EXIT EXPRESSION"); + return; + + + parensNesting++; break; - case ')': //Token.RP: - parensNesting--; - break; + + } break;