var isInObjectLitAr;
this.scopes.push(scope);
- var scopeIndent = '';
- this.scopes.forEach(function() {
- scopeIndent += ' ';
- });
+ //var scopeIndent = '';
+ //this.scopes.forEach(function() {
+ // scopeIndent += ' ';
+ //});
//print(scopeIndent + ">> ENTER SCOPE");
switch(token.type + '.' + token.name) {
case "KEYW.VAR":
case "KEYW.CONST": // not really relivant as it's only mozzy that does this.
-
+ print('SCOPE-VAR:' + token.toString());
var vstart = this.ts.cursor +1;
//this.log("parseScope GOT VAR/CONST : " + token.toString());
break;
case "KEYW.FUNCTION":
+ print('SCOPE-FUNC:' + token.toString());
//println("<i>"+token.data+"</i>");
var bn = this.braceNesting;
this.parseFunctionDeclaration();
break;
case "PUNC.LEFT_CURLY": // {
+
//println("<i>"+token.data+"</i>");
+
+ if (token.props) {
+ var curTS = this.ts;
+ for (var prop in token.props) {
+ if (token.props[prop].val.data == 'function') {
+ // parse a function..
+ this.parseFunctProp(token.props[prop]);
+ continue;
+ }
+ // key value..
+
+ this.ts = new TokenStream(token.props[prop].val);
+ this.parseScope(scope);
+
+ }
+ this.ts = curTS;
+
+ // it's an object literal..
+ // the values could be replaced..
+
+ }
+ print('SCOPE-CURLY:' + JSON.stringify(token,null,4));
+ print("NOT PROPS"); Seed.quit();
+
isObjectLitAr.push(false);
this.braceNesting++;
//print(">>>>>> OBJLIT PUSH(false)" + this.braceNesting);
break;
-
+/*
case "PUNC.RIGHT_CURLY": // }
//println("<i>"+token.data+"</i>");
this.braceNesting--;
return;
}
break;
-
+*/
case "KEYW.WITH":
+ print('SCOPE-WITH:' + token.toString());
//println("<i>"+token.data+"</i>");
if (this.mode == "BUILDING_SYMBOL_TREE") {
// Inside a 'with' block, it is impossible to figure out
break;
case "KEYW.CATCH":
+ print('SCOPE-CATCH:' + token.toString());
//println("<i>"+token.data+"</i>");
this.parseCatch();
break;
case "STRN.DOUBLE_QUOTE": // used for object lit detection..
case "STRN.SINGLE_QUOTE":
+ print('SCOPE-STRING:' + token.toString());
//println("<i>"+token.data+"</i>");
+
if (this.ts.lookTok(-1).data == '{' && this.ts.lookTok(1).data == ':') {
// then we are in an object lit.. -> we need to flag the brace as such...
isObjectLitAr.pop();
break;
case "NAME.NAME":
-
+ print('SCOPE-NAME:' + token.toString());
//print("DEAL WITH NAME:");
// got identifier..
if (token.type != 'KEYW') {
break;
}
+ print('SCOPE-KEYW:' + token.toString());
// print("Check eval:");
symbol = token.data;