X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=JSDOC%2FWalker2.js;h=db484bf9aa46f6875024d12f3016651951232c94;hp=0bdaf7ab089cb91444a0630a9cdc150bd51891e3;hb=9619ad9206a8ddd8107024aa32b024cbf81e8586;hpb=e3277a2e6c2f9187df1dc23d83c4498bd6282629 diff --git a/JSDOC/Walker2.js b/JSDOC/Walker2.js index 0bdaf7a..db484bf 100644 --- a/JSDOC/Walker2.js +++ b/JSDOC/Walker2.js @@ -148,13 +148,13 @@ Walker2 = XObject.define( var scopeLen = this.scopes.length; if (this.ts.cursor < 1) { - this.ts.cursor--; // hopeflly this kludge will work - } - + // this.ts.cursor--; // hopeflly this kludge will work + } + //print(JSON.stringify(this.ts, null, 4)); Seed.quit(); - while (false != (token = this.ts.next())) { + while (null != (token = this.ts.next())) { //print("TOK"+ token.toString()); // this.timerPrint("parseScope AFTER lookT: " + token.toString()); @@ -221,16 +221,16 @@ Walker2 = XObject.define( if (token.name == 'VAR' && - this.ts.lookT(1).type == 'NAME' && - this.ts.lookT(2).data == '-' && - this.ts.lookT(3).type == 'NAME' && - this.ts.lookT(4).data == ';' + this.ts.lookTok(1).type == 'NAME' && + this.ts.lookTok(2).data == '-' && + this.ts.lookTok(3).type == 'NAME' && + this.ts.lookTok(4).data == ';' ) { - //print("SET ALIAS:" + this.ts.lookT(1).data +'=' + this.ts.lookT(3).data); + //print("SET ALIAS:" + this.ts.lookTok(1).data +'=' + this.ts.lookTok(3).data); - aliases[this.ts.lookT(1).data] = this.ts.lookT(3).data; + aliases[this.ts.lookTok(1).data] = this.ts.lookTok(3).data; } @@ -253,29 +253,29 @@ Walker2 = XObject.define( if (/\.extend$/.test(token.data) && - this.ts.lookT(1).data == '(' && - this.ts.lookT(2).type == 'NAME' && - this.ts.lookT(3).data == ',' && - this.ts.lookT(4).type == 'NAME' && - this.ts.lookT(5).data == ',' && - this.ts.lookT(6).data == '{' - } + this.ts.lookTok(1).data == '(' && + this.ts.lookTok(2).type == 'NAME' && + this.ts.lookTok(3).data == ',' && + this.ts.lookTok(4).type == 'NAME' && + this.ts.lookTok(5).data == ',' && + this.ts.lookTok(6).data == '{' + ) { // ignore test for ( a and , - this.ts.nextT(); /// ( - token = this.ts.nextT(); // a + this.ts.nextTok(); /// ( + token = this.ts.nextTok(); // a scopeName = token.data; if (this.currentDoc) { this.addSymbol(scopeName,false,'OBJECT'); } - this.ts.nextT(); // , - this.ts.nextT(); // b + this.ts.nextTok(); // , + this.ts.nextTok(); // b - this.ts.nextT(); // , - token = this.ts.nextT(); // { + this.ts.nextTok(); // , + token = this.ts.nextTok(); // { scopeName = fixAlias(scopeName); @@ -294,25 +294,25 @@ Walker2 = XObject.define( // a = Roo.extend(parentname, { if (/\.extend$/.test(token.data) && - this.ts.lookT(-2).type == 'NAME' && - this.ts.lookT(-1).data == '=' && - this.ts.lookT(1).data == '(' && - this.ts.lookT(2).type == 'NAME' && - this.ts.lookT(3).data == ',' && - this.ts.lookT(4).data == '{' + this.ts.lookTok(-2).type == 'NAME' && + this.ts.lookTok(-1).data == '=' && + this.ts.lookTok(1).data == '(' && + this.ts.lookTok(2).type == 'NAME' && + this.ts.lookTok(3).data == ',' && + this.ts.lookTok(4).data == '{' ) { // ignore test for ( a and , - token = this.ts.lookT(-2); + token = this.ts.lookTok(-2); scopeName = token.data; if (this.currentDoc) { this.addSymbol(scopeName,false,'OBJECT'); } - this.ts.nextT(); /// ( - this.ts.nextT(); // parent + this.ts.nextTok(); /// ( + this.ts.nextTok(); // parent - this.ts.nextT(); // , - token = this.ts.nextT(); // { + this.ts.nextTok(); // , + token = this.ts.nextTok(); // { scopeName = fixAlias(scopeName); @@ -332,17 +332,17 @@ Walker2 = XObject.define( // apply ( XXXX, { if (/\.(applyIf|apply)$/.test(token.data) && - this.ts.lookT(1).data == '(' && - this.ts.lookT(2).type == 'NAME' && - this.ts.lookT(3).data == ',' && - this.ts.lookT(4).data == '{' + this.ts.lookTok(1).data == '(' && + this.ts.lookTok(2).type == 'NAME' && + this.ts.lookTok(3).data == ',' && + this.ts.lookTok(4).data == '{' ) { - this.ts.nextT(); /// ( + this.ts.nextTok(); /// ( //print("GOT : applyIF!"); - token = this.ts.nextT(); // b + token = this.ts.nextTok(); // b scopeName = token.data; @@ -353,8 +353,8 @@ Walker2 = XObject.define( - this.ts.nextT(); /// , - this.ts.nextT(); // { + this.ts.nextTok(); /// , + this.ts.nextTok(); // { scopeName = fixAlias(scopeName); var fnScope = new Scope(this.braceNesting, scope, token.n, scopeName); this.indexedScopes[this.ts.cursor] = fnScope; @@ -371,11 +371,11 @@ Walker2 = XObject.define( // change scope to xxxx - if ( this.ts.lookT(1).data == '=' && - this.ts.lookT(2).name == 'NEW' && - this.ts.lookT(3).type == 'NAME' && - this.ts.lookT(4).data == '(' && - this.ts.lookT(5)..data == '{' + if ( this.ts.lookTok(1).data == '=' && + this.ts.lookTok(2).name == 'NEW' && + this.ts.lookTok(3).type == 'NAME' && + this.ts.lookTok(4).data == '(' && + this.ts.lookTok(5).data == '{' ) { scopeName = token.data; if (this.currentDoc) { @@ -383,11 +383,11 @@ Walker2 = XObject.define( } - this.ts.nextT(); /// = - this.ts.nextT(); /// new - this.ts.nextT(); /// yyy - this.ts.nextT(); /// ( - this.ts.nextT(); /// { + this.ts.nextTok(); /// = + this.ts.nextTok(); /// new + this.ts.nextTok(); /// yyy + this.ts.nextTok(); /// ( + this.ts.nextTok(); /// { scopeName = fixAlias(scopeName); var fnScope = new Scope(this.braceNesting, scope, token.n, scopeName); @@ -432,16 +432,16 @@ Walker2 = XObject.define( // ident = function () var atype = 'OBJECT'; - if (((this.ts.lookT(1).data == ':' )|| (this.ts.lookT(1).data == '=')) && - (this.ts.lookT(2).name == "FUNCTION") + if (((this.ts.lookTok(1).data == ':' )|| (this.ts.lookTok(1).data == '=')) && + (this.ts.lookTok(2).name == "FUNCTION") ) { atype = 'FUNCTION'; } - //print("ADD SYM:" + atype + ":" + token.toString() + this.ts.lookT(1).toString() + this.ts.lookT(2).toString()); + //print("ADD SYM:" + atype + ":" + token.toString() + this.ts.lookTok(1).toString() + this.ts.lookTok(2).toString()); this.addSymbol( - this.ts.lookT(-1).tokN == Script.TOKdot ? token.data : fixAlias(token.data), + this.ts.lookTok(-1).tokN == Script.TOKdot ? token.data : fixAlias(token.data), false, atype); @@ -481,12 +481,12 @@ Walker2 = XObject.define( //$this$=foo.prototype|$private$|foo.prototype if ( - (this.ts.lookT(-1).data == '=') && - (this.ts.lookT(-2).type == 'NAME') + (this.ts.lookTok(-1).data == '=') && + (this.ts.lookTok(-2).type == 'NAME') ) { - scopeName = this.ts.lookT(-2).data; + scopeName = this.ts.lookTok(-2).data; this.ts.balanceN('('); - token = this.ts.nextT(); // should be { + token = this.ts.nextTok(); // should be { //print("FOO=FUNCITON() {}" + this.ts.context() + "\n" + token.toString()); @@ -513,13 +513,13 @@ Walker2 = XObject.define( //$private$ if ( - (this.ts.lookT(-1).name == 'NEW') && - (this.ts.lookT(-2).data == '=') - (this.ts.lookT(-3).type = 'FUNCTION') + (this.ts.lookTok(-1).name == 'NEW') && + (this.ts.lookTok(-2).data == '=') && + (this.ts.lookTok(-3).type = 'FUNCTION') ) { //scopeName = this.ts.look(-3).data; this.ts.balanceN(Script.TOKlparen); - token = this.ts.nextT(); // should be { + token = this.ts.nextTok(); // should be { scopeName = fixAlias(scopeName); var fnScope = new Scope(this.braceNesting, scope, token.n, '$private$'); this.indexedScopes[this.ts.cursor] = fnScope; @@ -542,18 +542,18 @@ Walker2 = XObject.define( // no change to scoping.. //print("checking for : function() {"); - //print( [this.ts.lookT(-3).type , this.ts.lookT(-2).type , this.ts.lookT(-1).type ].join(":")); + //print( [this.ts.lookTok(-3).type , this.ts.lookTok(-2).type , this.ts.lookTok(-1).type ].join(":")); if ( - (this.ts.lookT(-1).tokN == Script.TOKcolon) && - (this.ts.lookT(-2).tokN == Script.TOKidentifier) && - (this.ts.lookT(-3).tokN == Script.TOKlbrace || this.ts.lookT(-3).tokN == Script.TOKcomma) + (this.ts.lookTok(-1).data == ':') && + (this.ts.lookTok(-2).type == 'NAME') && + (this.ts.lookTok(-3).data == '(' || this.ts.lookTok(-3).data== ',') ) { //print("got for : function() {"); //scopeName = this.ts.look(-3).data; this.ts.balanceN(Script.TOKlparen); //print(token.toString()) - token = this.ts.nextT(); // should be { + token = this.ts.nextTok(); // should be { //print(token.toString()) scopeName = fixAlias(scopeName); var fnScope = new Scope(this.braceNesting, scope, token.n, ''); @@ -571,11 +571,11 @@ Walker2 = XObject.define( //$this$=foo if ( - (this.ts.lookT(1).tokN == Script.TOKidentifier) + (this.ts.lookTok(1).type == 'NAME') ) { //scopeName = this.ts.look(-3).data; - this.ts.balanceN(Script.TOKlparen); - token = this.ts.nextT(); // should be { + this.ts.balanceN('('); + token = this.ts.nextTok(); // should be { var fnScope = new Scope(this.braceNesting, scope, token.n, ''); this.indexedScopes[this.ts.cursor] = fnScope; @@ -594,16 +594,16 @@ Walker2 = XObject.define( // RETURN function(...) { if ( - // (this.ts.lookT(-1).tokN == Script.TOKlparen) && - (this.ts.lookT(1).tokN != Script.TOKidentifier) + // (this.ts.lookTok(-1).tokN == Script.TOKlparen) && + (this.ts.lookTok(1).name != 'NAME') - // (this.ts.lookT(-2).tokN == Script.TOKnew) && - // (this.ts.lookT(-3).tokN == Script.TOKassign) && - // (this.ts.lookT(-4).tokN == Script.TOKidentifier) + // (this.ts.lookTok(-2).tokN == Script.TOKnew) && + // (this.ts.lookTok(-3).tokN == Script.TOKassign) && + // (this.ts.lookTok(-4).tokN == Script.TOKidentifier) ) { //scopeName = this.ts.look(-3).data; - this.ts.balanceN(Script.TOKlparen); - token = this.ts.nextT(); // should be { + this.ts.balanceN('('); + token = this.ts.nextTok(); // should be { var fnScope = new Scope(this.braceNesting, scope, token.n, '$private$'); this.indexedScopes[this.ts.cursor] = fnScope; //scope = ; @@ -627,16 +627,16 @@ Walker2 = XObject.define( } // end checking for TOKfunction - if (token.tokN == Script.TOKlbrace) { + if (token.data == '{') { // foo = { // !var!!! //$this$=foo|Foo if ( - (this.ts.lookT(-1).tokN == Script.TOKassign) && - (this.ts.lookT(-2).tokN == Script.TOKidentifier) && - (this.ts.lookT(-3).tokN != Script.TOKvar) + (this.ts.lookTok(-1).data == '=') && + (this.ts.lookTok(-2).type == 'NAME') && + (this.ts.lookTok(-3).nane != 'VAR') ) { scopeName = this.ts.look(-2).data; @@ -658,12 +658,12 @@ Walker2 = XObject.define( //print("GOT LBRACE : check for :"); if ( - (this.ts.lookT(-1).tokN == Script.TOKcolon) && - (this.ts.lookT(-2).tokN == Script.TOKidentifier) && - (this.ts.lookT(-3).tokN != Script.TOKvar) + (this.ts.lookTok(-1).data == ':') && + (this.ts.lookTok(-2).type == 'NAME') && + (this.ts.lookTok(-3).name != 'VAR') ) { - scopeName = this.ts.lookT(-2).data; + scopeName = this.ts.lookTok(-2).data; scopeName = fixAlias(scopeName); var fnScope = new Scope(this.braceNesting, scope, token.n, scopeName); this.indexedScopes[this.ts.cursor] = fnScope; @@ -684,7 +684,7 @@ Walker2 = XObject.define( continue; } - if (token.tokN == Script.TOKrbrace) { + if (token.data == '{') { if (this.currentDoc) {