log : function(str)
{
- print (" ".substring(0, this.braceNesting) + str);
+ print (" ".substring(0, this.braceNesting*2) + str);
//println("<B>LOG:</B>" + htmlescape(str) + "<BR/>\n");
},
while (token) {
// this.timerPrint("parseScope AFTER lookT: " + token.toString());
- this.log(token.type + '.' + token.name+ ":" + 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);
//print(">>>>>> OBJLIT POP"+ this.braceNesting);
//assert braceNesting >= scope.getBra ceNesting();
- if (this.braceNesting < 0) {
+ if (this.braceNesting < expressionBraceNesting) {
var ls = this.scopes.pop();
ls.getUsedSymbols();
+ // eat symbol if we are currently at {
+ if (this.ts.look(0).data == '{') {
+ this.ts.nextTok();
+ }
+
//print("<<<<<<<EXIT SCOPE" +this.scopes.length);
return;
}
this.indexedScopes[this.ts.cursor] = fnScope;
} else {
- //println("FETCHING SCOPE" + this.ts.cursor);
+ //qln("FETCHING SCOPE" + this.ts.cursor);
fnScope = this.indexedScopes[this.ts.cursor];
}