this.ts.rewind();
this.braceNesting = 0;
this.scopes= [];
- this.mode = 'MUNGING_SYMBOL_TREE';
+ this.mode = 'PASS2_SYMBOL_TREE';
//println("MUNGING?");
break;
}
symbol = token.data;
- if (this.mode == 'MUNGING_SYMBOL_TREE') {
+ if (this.mode == 'PASS2_SYMBOL_TREE') {
//println("GOT IDENT: -2 : " + this.ts.lookT(-2).toString() + " <BR> ..... -1 : " + this.ts.lookT(-1).toString() + " <BR> ");
-
+ //print ("MUNGE?" + symbol);
//println("GOT IDENT: <B>" + symbol + "</B><BR/>");
break;
}
- if (this.mode == 'CHECKING_SYMBOL_TREE') {
+ if (this.mode == 'PASS2_SYMBOL_TREE') {
identifier = this.getIdentifier(symbol, currentScope);
//println("<B>??</B>");
parseFunctionDeclaration : function()
{
-
+ // print("PARSE FUNCTION");
var symbol;
var token;
var currentScope = false;
// Parse function arguments.
var argpos = 0;
- while (!this.ts.lookTok().data == ')') { //(token = consumeToken()).getType() != Token.RP) {
+ while (this.ts.lookTok().data != ')') { //(token = consumeToken()).getType() != Token.RP) {
token = this.ts.nextTok();
-
+ // print ("FUNC ARGS: " + token.toString())
//assert token.getType() == Token.NAME ||
// token.getType() == Token.COMMA;
if (token.type == 'NAME' && this.mode == 'BUILDING_SYMBOL_TREE') {