break;
case "PUNC.LEFT_CURLY": // {
-
+ case "PUNC.LEFT_PAREN": // (
//println("<i>"+token.data+"</i>");
-
+ var curTS = this.ts;
if (token.props) {
- var curTS = this.ts;
+
for (var prop in token.props) {
if (token.props[prop].val.data == 'function') {
// parse a function..
// it's an object literal..
// the values could be replaced..
-
+ break;
}
+
print('SCOPE-CURLY:' + JSON.stringify(token,null,4));
- print("NOT PROPS"); Seed.quit();
+ var _this = this;
+ token.items.forEach(function(expr) {
+ _this.ts = new TokenStream(expr);
+ _this.parseExpression(scope)
+ });
+ this.ts = curTS;
+ //print("NOT PROPS"); Seed.quit();
- isObjectLitAr.push(false);
- this.braceNesting++;
+ //isObjectLitAr.push(false);
+ //this.braceNesting++;
//print(">>>>>> OBJLIT PUSH(false)" + this.braceNesting);
break;
-/*
+
case "PUNC.RIGHT_CURLY": // }
+ print("<< EXIT SCOPE");
+ return;
+ /*
//println("<i>"+token.data+"</i>");
this.braceNesting--;
isObjectLitAr.pop();
//if (this.ts.nextT()) break;
}
+ print("<<< EXIT SCOPE");
//print("<<<<<<<EXIT SCOPE ERR?" +this.scopes.length);
},
//print(scopeIndent + ">> ENTER EXPRESSION" + this.expN);
- while (token = this.ts.lookTok()) {
+ while (token = this.ts.nextTok()) {
-
+
/*
// moved out of loop?
*/
//this.dumpToken(token, this.scopes, this.braceNesting );
- //print('EXP' + this.expN + ':' + token.toString());
+ print('EXP' + token.toString());
//println("<i>"+token.data+"</i>");
if (this.braceNesting == expressionBraceNesting &&
bracketNesting == 0 &&
parensNesting == 0) {
- print(scopeIndent + "<< EXIT EXPRESSION");
+ print("<< EXIT EXPRESSION");
this.expN--;
return;
}
var ts = this.ts;
var _this = this;
token.items.forEach(function(ns) {
+ print("EXPR-PUNC-MAKE:" + JSON.stringify(ns, null, 4));
_this.ts = new TokenStream(ns);
+ //_this.ts.cursor--;
_this.parseExpression();
});
+ this.ts = ts;
break;
-/*
+
case ']': //Token.RB:
- bracketNesting--;
- break;
-*/
+ print("<< EXIT EXPRESSION");
+ return;
+
+
case '(': //Token.LP:
parensNesting++;
break;
//println("<B>EID</B>");
- case 'KEYW':
+ case 'KEYW':
print("EXPR-KEYW:" + JSON.stringify(token, null, 4));
if (token.name == "FUNCTION") {
}
break;
}
-
+ default:
+ print("EXPR-SKIP:" + JSON.stringify(token, null, 4));
+ break;
}
- if (!this.ts.nextTok()) break;
+
}
print("<< EXIT EXPRESSION");
this.expN--;