foreach (var p in this.keys()) {
var symbol = this.getSymbol(p);
- if (symbol.is("FILE") || symbol.is("GLOBAL")) continue;
+ if (symbol.is("FILE") || symbol.is("GLOBAL")) {
+ continue;
+ }
// the memberOf value was provided in the @memberOf tag
- else if (symbol.memberOf.length > 0) {
+
+ GLib.debug("Resolve: %s memberOf=%s", symbol.alias, symbol.memberOf);
+ if (symbol.memberOf.length > 0) {
var regex = new GLib.Regex("^("+symbol.memberOf+"[.#-])(.+)$");
GLib.MatchInfo minfo;
var parts = regex.match_full(symbol.alias, -1, 0, 0 , out minfo);
// like foo.bar is a memberOf foo
if (parts) {
-
symbol.memberOf = minfo.fetch(1);
symbol.private_name = minfo.fetch(2);
}
this.renameSymbol(p, symbol.memberOf + symbol.name);
}
- }
+ } else {
// the memberOf must be calculated
- else {
+
GLib.MatchInfo minfo;
var parts = /^(.*[.#-])([^.#-]+)$/.match_full(symbol.alias, -1, 0, 0 , out minfo);
}
// set isStatic, isInner
- if (symbol.memberOf.length > 0) {
+ if (symbol.memberOf.length > 0 && !symbol.is("CONSTRUCTOR")) {
switch (symbol.memberOf[symbol.memberOf.length-1]) {
case '#' :
symbol.isStatic = false;
// add it to the current scope????
this.addSymbol("", true);
+ GLib.debug("Call addSymbol EMPTY");
//print ( "Unconsumed Doc: " + token.toString())
//throw "Unconsumed Doc (TOKwhitespace): " + this.currentDoc.toSource();
}
if (this.currentDoc != null && (
token.data == ";" ||
token.data == "}")) {
+
+ GLib.debug("Call addSymbol EMPTY");
this.addSymbol("", true);
+
//throw "Unconsumed Doc ("+ token.toString() +"): " + this.currentDoc.toSource();
}
scopeName = token.data;
if (this.currentDoc != null) {
+ GLib.debug("Call addSymbol %s", scopeName);
this.addSymbol(scopeName,false,"OBJECT");
}
token = this.ts.lookTok(-2);
scopeName = token.data;
if (this.currentDoc != null) {
+ GLib.debug("Call addSymbol %s", scopeName);
this.addSymbol(scopeName,false,"OBJECT");
}
if (this.currentDoc != null) {
+ GLib.debug("Call addSymbol %s", scopeName);
this.addSymbol(scopeName,false,"OBJECT");
}
) {
scopeName = token.data;
if (this.currentDoc != null) {
+ GLib.debug("Call addSymbol %s", scopeName);
this.addSymbol(scopeName,false,"OBJECT");
}
// ident : function ()
// ident = function ()
+ // this.ident = function()
var atype = "OBJECT";
if (((this.ts.lookTok(1).data == ":" )|| (this.ts.lookTok(1).data == "=")) &&
}
//print("ADD SYM:" + atype + ":" + token.toString() + this.ts.lookTok(1).toString() + this.ts.lookTok(2).toString());
-
- this.addSymbol(
- this.ts.lookTok(-1).data == "." ? token.data : this.fixAlias(aliases,token.data),
- false,
- atype);
+ var tname = this.ts.lookTok(-1).data == "." ? token.data : this.fixAlias(aliases,token.data);
+
+ if (/^this\./.match(tname)) {
+ tname = tname.substring(5);
+ }
+ GLib.debug("Call addSymbol %s", tname);
+ this.addSymbol( tname, false, atype);
this.currentDoc = null;
if (token.isType(TokenType.STRN)) { // THIS WILL NOT HAPPEN HERE?!!?
if (this.currentDoc != null) {
+ GLib.debug("Call addSymbol %s", token.data.substring(1,token.data.length-1));
this.addSymbol(token.data.substring(1,token.data.length-1),false,"OBJECT");
}
}
if (token.isName(TokenName.FUNCTION)) {
+ GLib.debug("Got Function");
//print("GOT FUNCTION");
// see if we have an unconsumed doc...
(this.ts.lookTok(-1).data == "=") &&
(this.ts.lookTok(-2).isType(TokenType.NAME))
) {
+
scopeName = this.ts.lookTok(-2).data;
+ GLib.debug("Got %s = Function", scopeName);
this.ts.balance(TokenName.LEFT_PAREN);
token = this.ts.nextTok(); // should be {
//print("FOO=FUNCITON() {}" + this.ts.context() + "\n" + token.toString());
scopeName = this.fixAlias(aliases, scopeName);
+
var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
"$this$="+scopeName+".prototype|$private$|"+scopeName+".prototype",
null
this.indexedScopes.set(this.ts.cursor, fnScope);
//scope = fnScope;
- //this.scopesIn(fnScope);
+ // this.scopesIn(fnScope);
this.parseScope(fnScope, aliases);
// foo = new function() {}
- // is this actually used much!?!?!
+ // is this actually used much!?!?! --
//$private$
if (
this.indexedScopes.set(this.ts.cursor, fnScope);
//scope = fnScope;
- //this.scopesIn(fnScope);
+ // this.scopesIn(fnScope);
this.parseScope(fnScope, aliases);
locBraceNest++;
this.indexedScopes.set(this.ts.cursor, fnScope);
//scope = fnScope;
- //this.scopesIn(fnScope);
+ // this.scopesIn(fnScope);
this.parseScope(fnScope, aliases);
locBraceNest++;
//print(">>" +locBraceNest);
);
this.indexedScopes.set(this.ts.cursor, fnScope);
- //scope = fnScope;
- //this.scopesIn(fnScope);
+ // scope = fnScope;
+ // this.scopesIn(fnScope);
this.parseScope(fnScope, aliases);
locBraceNest++;
//print(">>" +locBraceNest);
this.indexedScopes.set(this.ts.cursor, fnScope);
//scope = ;
- //this.scopesIn(fnScope);
+ // this.scopesIn(fnScope);
this.parseScope(fnScope, aliases);
locBraceNest++;
//print(">>" +locBraceNest);
scope = fnScope;
// push the same scope onto the stack..
this.scopesIn(fnScope);
- //this.scopesIn(this.scopes[this.scopes.length-1]);
+ // this.scopesIn(this.scopes[this.scopes.length-1]);
locBraceNest++;
if (this.currentDoc != null) {
+ GLib.debug("Call addSymbol EMPTY");
this.addSymbol("", true);
//throw "Unconsumed Doc: (TOKrbrace)" + this.currentDoc.toSource();
//print("<<<<<< " + locBraceNest );
if (locBraceNest < 0) {
// print("POPED OF END OF SCOPE!");
- ///this.scopeOut();
- //var ls = this.scopeOut();
- //ls.getUsedSymbols();
+ // this.scopeOut();
+ // var ls = this.scopeOut();
+ // ls.getUsedSymbols();
return;
}
continue;