//this.log("parseScope GOT VAR/CONST : " + token.toString());
while (true) {
- token = this.ts.next();
+ token = this.ts.nextTok();
if (token.name == "var") { // kludge..
continue;
}
}
- token = this.ts.next();
+ token = this.ts.nextTok();
/*
assert token.getType() == Token.SEMI ||
token.getType() == Token.ASSIGN ||
//this.logR("parseScope DONE : <B>ParseExpression</B> - tok is:" + this.ts.lookT(0).toString());
- if (this.ts.look(0).data == ';') {
+ if (this.ts.lookTok(0).data == ';') {
break;
}
}
case "STRN.DOUBLE_QUOTE": // used for object lit detection..
case "STRN.SINGLE_QUOTE":
//println("<i>"+token.data+"</i>");
- if (this.ts.look(-1).data == '{' && this.ts.look(1).data == ':') {
+ 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();
isObjectLitAr.push(true);
}
var isInObjectLitAr = isObjectLitAr[isObjectLitAr.length-1];
- if (isInObjectLitAr && this.ts.look(1).data == ':' &&
- ( this.ts.look(-1).data == '{' || this.ts.look(-1).data == ':' )) {
+ if (isInObjectLitAr && this.ts.lookTok(1).data == ':' &&
+ ( this.ts.lookTok(-1).data == '{' || this.ts.lookTok(-1).data == ':' )) {
// see if we can replace..
// remove the quotes..
// should do a bit more checking!!!! (what about wierd char's in the string..
// got identifier..
// look for { ** : <- indicates obj literal.. ** this could occur with numbers ..
- if ((this.ts.look(-1).data == "{") && (this.ts.look(1).data == ":")) {
+ if ((this.ts.lookTok(-1).data == "{") && (this.ts.lookTok(1).data == ":")) {
isObjectLitAr.pop();
isObjectLitAr.push(true);
//println("<i>"+token.data+"</i>");
}
var isInObjectLitAr = isObjectLitAr[isObjectLitAr.length-1];
- if (isInObjectLitAr && (this.ts.look(1).data == ":") && (this.ts.look(-1).data == ",")) {
+ if (isInObjectLitAr && (this.ts.lookTok(1).data == ":") && (this.ts.lookTok(-1).data == ",")) {
// skip, it's an object lit key..
//println("<i>"+token.data+"</i>");
break;
// skip anyting with "." before it..!!
- if (this.ts.look(-1).data(".")) {
+ if (this.ts.lookTok(-1).data(".")) {
// skip, it's an object prop.
//println("<i>"+token.data+"</i>");
break;
//this.timerPrint("parseScope TOK : " + token.toString());
- token = this.ts.next();
+ token = this.ts.nextTok();
//if (this.ts.nextT()) break;
}
var parensNesting = 0;
var isObjectLitAr = [ false ];
- while (token = this.ts.look()) {
+ while (token = this.ts.lookTok()) {
switch(token.type) {
case 'STRN': // used for object lit detection..
- if (this.ts.look(-1).data == "{" && this.ts.look(1).data == ":" ) {
+ 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();
isObjectLitAr.push(true);
var isInObjectLitAr = isObjectLitAr[isObjectLitAr.length-1];
- if (isInObjectLitAr && this.ts.look(1).data = ":" &&
- ( this.ts.look(-1).data == "{" || this.ts.look(-1).data == "," )) {
+ if (isInObjectLitAr && this.ts.lookTok(1).data = ":" &&
+ ( this.ts.lookTok(-1).data == "{" || this.ts.lookTok(-1).data == "," )) {
// see if we can replace..
// remove the quotes..
var str = token.data.substring(1,token.data.length-1);
case 'NAME':
case 'KEYW':
symbol = token.data;
- if (this.ts.look(-1).data == "{" && this.ts.look(1).data == ":") {
+ 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();
isObjectLitAr.push(true);
break;
}
var isInObjectLitAr = isObjectLitAr[isObjectLitAr.length-1];
- if (isInObjectLitAr && this.ts.look(-1).data == "," && this.ts.look(1).data == ":") {
+ if (isInObjectLitAr && this.ts.lookTok(-1).data == "," && this.ts.lookTok(1).data == ":") {
break;
}
- if (this.ts.look(-1).data == ".") {
+ if (this.ts.lookTok(-1).data == ".") {
//skip '.'
break;
}
if (this.mode == 'BUILDING_SYMBOL_TREE') {
if (symbol == "eval") {
- if (this.ts.look(-1).isDoc()) {
+ if (this.ts.look(-1).type == 'COMM') {
// look for eval:var:noreplace\n
var _t = this;
this.ts.look(-1).data.replace(/eval:var:([a-z]+)/ig, function(m, a) {
//println("<B>??</B>");
if (identifier == false) {
- if (symbol.length <= 3 && JSDOC.Scope.builtin.indexOf(symbol) < 0) {
+ if (symbol.length <= 3 && Scope.builtin.indexOf(symbol) < 0) {
// Here, we found an undeclared and un-namespaced symbol that is
// 3 characters or less in length. Declare it in the global scope.
// We don't need to declare longer symbols since they won't cause
}
break;
}
- if (!this.ts.nextT()) break;
+ if (!this.ts.nextTok()) break;
}
},
//token = getToken(-1);
//assert token.getType() == Token.CATCH;
- token = this.ts.nextT();
+ token = this.ts.nextTok();
//assert token.getType() == Token.LP; (
- token = this.ts.nextT();
+ token = this.ts.nextTok();
//assert token.getType() == Token.NAME;
symbol = token.data;
identifier.refcount++;
}
- token = this.ts.nextT();
+ token = this.ts.nextTok();
//assert token.getType() == Token.RP; // )
},
{
var symbol;
- var token;
+ var token;
var currentScope = false;
var fnScope = false;
var identifier;
//this.logR("<B>PARSING FUNCTION</B>");
currentScope = this.scopes[this.scopes.length-1];
- token = this.ts.nextT();
- if (token.isType('identifier')) {
+ token = this.ts.nextTok();
+ if (token.type == "NAME") {
if (this.mode == 'BUILDING_SYMBOL_TREE') {
// Get the name of the function and declare it in the current scope.
symbol = token.data;
}
currentScope.declareIdentifier(symbol,token);
}
- token = this.ts.nextT();
+ token = this.ts.nextTok();
}
//assert token.getType() == Token.LP;
// Parse function arguments.
var argpos = 0;
- while (!this.ts.look().isType('rparen')) { //(token = consumeToken()).getType() != Token.RP) {
- token = this.ts.nextT();
+ while (!this.ts.lookTok().data == ')') { //(token = consumeToken()).getType() != Token.RP) {
+ token = this.ts.nextTok();
//assert token.getType() == Token.NAME ||
// token.getType() == Token.COMMA;
- if (token.isType('identifier') && this.mode == 'BUILDING_SYMBOL_TREE') {
+ if (token.type == 'NAME' && this.mode == 'BUILDING_SYMBOL_TREE') {
symbol = token.data;
identifier = fnScope.declareIdentifier(symbol,token);
if (symbol == "$super" && argpos == 0) {
}
}
- token = this.ts.nextT();
+ token = this.ts.nextTok();
// assert token.getType() == Token.LC;
this.braceNesting++;
- token = this.ts.nextT();
- if (token.isType('string') && this.ts.look(1).isType('semicolon')) {
+ token = this.ts.nextTok();
+ if (token.type == "STRN" && this.ts.lookTok(1).data == ';') {
/*
NOT SUPPORTED YET!?!!?!