X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FScopeParser.js;h=619dd6c8f7f63ea1ca7cd9e09760aeb3426a8c8e;hb=462346234089eecf2266b206fa50a984e73cc7ed;hp=49041305b29e4bde2483ec8ed3b7fbb77a9d875e;hpb=d4368d6a39ba7e0f2875e9f42e52cd522ec5c336;p=gnome.introspection-doc-generator diff --git a/JSDOC/ScopeParser.js b/JSDOC/ScopeParser.js index 4904130..619dd6c 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("<<<<<<> ENTER EXPRESSION" + this.expN); - while (token = this.ts.lookTok()) { + while (token = this.ts.nextTok()) { @@ -635,19 +647,20 @@ ScopeParser.prototype = { var ts = this.ts; var _this = this; token.items.forEach(function(ns) { - print("EXPR-PUNC[:" + JSON.stringify(ns, null, 4)); + print("EXPR-PUNC-MAKE:" + JSON.stringify(ns, null, 4)); _this.ts = new TokenStream(ns); - _this.ts.cursor--; + //_this.ts.cursor--; _this.parseExpression(); }); this.ts = ts; break; -/* + case ']': //Token.RB: - bracketNesting--; - break; -*/ + print("<< EXIT EXPRESSION"); + return; + + case '(': //Token.LP: parensNesting++; break; @@ -785,7 +798,7 @@ ScopeParser.prototype = { print("EXPR-SKIP:" + JSON.stringify(token, null, 4)); break; } - if (!this.ts.nextTok()) break; + } print("<< EXIT EXPRESSION"); this.expN--;