parseScope : function(scope) // parse a token stream..
{
//this.timerPrint("parseScope EnterScope");
- print(">>> ENTER SCOPE" + this.scopes.length);
+ //this.log(">>> ENTER SCOPE" + this.scopes.length);
var symbol;
var token;
while (token) {
// this.timerPrint("parseScope AFTER lookT: " + token.toString());
- this.log(token.data);
+ //this.log(token.data);
if (token.type == 'NAME') {
// print('*' + token.data);
}
if (token.name == "IN") {
break;
} else {
- var bn = this.braceNesting;
+ //var bn = this.braceNesting;
this.parseExpression();
- this.braceNesting = bn;
+ //this.braceNesting = bn;
//this.logR("parseScope DONE : <B>ParseExpression</B> - tok is:" + this.ts.lookT(0).toString());
token = this.ts.lookTok(1);
currentScope = this.scopes[this.scopes.length-1];
//println("<i>"+token.data+"</i>");
- !this.debug|| print ("EXP" + token.toString());
+ //this.log("EXP:" + token.data);
switch (token.type) {
case 'PUNC':
switch(token.data) {
case 'NAME':
symbol = token.data;
- if (this.ts.lookTok(-1).data == "{" && this.ts.lookTok(1).data == ":") {
+
+ if (this.ts.look(0).data == "{" && this.ts.lookTok(2).data == ":") {
// then we are in an object lit.. -> we need to flag the brace as such...
isObjectLitAr.pop();
isObjectLitAr.push(true);
break;
}
isInObjectLitAr = isObjectLitAr[isObjectLitAr.length-1];
- if (isInObjectLitAr && this.ts.lookTok(-1).data == "," && this.ts.lookTok(1).data == ":") {
+ if (isInObjectLitAr && this.ts.lookTok(0).data == "," && this.ts.lookTok(2).data == ":") {
break;
}
-
- if (this.ts.lookTok(-1).data == ".") {
+ print(this.ts.lookTok(0).data);
+ if (this.ts.lookTok(0).data == ".") {
//skip '.'
break;
}