this.ident = lastIdent;
this.gid = Scope.gid++;
- //println("ADD SCOPE(" + this.id + ") TO "+ (parent ? this.parent.id : 'TOP') + "<BR/>");
+ print("ADD SCOPE(" + this.gid + ") TO "+ (parent ? this.parent.gid : 'TOP'));
if (parent) {
this.parent.subScopes.push(this);
protectedVars : {}, // only used by to parent..
declareIdentifier : function(symbol, token) {
- print("SCOPE : " + this.gid + " ADD IDENT(" + this.id + "):" + symbol+"");
+ print("SCOPE : " + this.gid " : " + token.toString()+"");
if (typeof(this.identifiers[symbol])== 'undefined') {
return this.identifiers[symbol];
},
getIdentifier : function(symbol) {
- return (typeof(this.identifiers[symbol])== 'undefined') ? false : this.identifiers[symbol];
+ if (typeof(this.identifiers[symbol])== 'undefined') {
+ print("SYMBOL NOT FOUND?" + symbol);
+ return false;
+ }
+
+ return this.identifiers[symbol];
},
addHint : function(varName, varType) {