break;
*/
case 'NAME':
- case 'KEYW':
+
symbol = token.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...
break;
}
+ if (this.mode == 'CHECKING_SYMBOL_TREE') {
+
+ identifier = this.getIdentifier(symbol, currentScope);
+ //println("<B>??</B>");
+ if (identifier == false) {
+
+ 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
+ // any conflict with other munged symbols.
+ this.globalScope.declareIdentifier(symbol, token);
+ this.warn("Found an undeclared symbol: " + symbol, true);
+ } else {
+ //println("undeclared")
+ }
+
+
+ } else {
+ //println("<B>++</B>");
+ token.identifier = identifier;
+ identifier.refcount++;
+ }
+
+ }
+ break;
- //println("<B>EID</B>");
+ //println("<B>EID</B>");
+ case 'KEYW':
+ symbol = token.data;
if (this.mode == 'BUILDING_SYMBOL_TREE') {
if (symbol == "eval") {
}
break;
}
- if (this.mode == 'CHECKING_SYMBOL_TREE') {
-
- identifier = this.getIdentifier(symbol, currentScope);
- //println("<B>??</B>");
- if (identifier == false) {
-
- 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
- // any conflict with other munged symbols.
- this.globalScope.declareIdentifier(symbol, token);
- this.warn("Found an undeclared symbol: " + symbol, true);
- } else {
- //println("undeclared")
- }
-
-
- } else {
- //println("<B>++</B>");
- token.identifier = identifier;
- identifier.refcount++;
- }
-
- }
- break;
+
}
if (!this.ts.nextTok()) break;
}