JSDOC/ScopeParser.vala
[gnome.introspection-doc-generator] / JSDOC / ScopeParser.vala
index 4d20246..c81bc1e 100644 (file)
@@ -659,11 +659,12 @@ namespace JSDOC {
                                }
                                
                                
-                               var _this = this;
-                               token.items.forEach(function(expr) {
-                                     _this.ts = new TokenStream(expr);
-                                     _this.parseExpression(scope)
-                               });
+                               foreach(var expr in token.items) {
+                                     this.ts = new TokenStream(expr);
+                                     this.parseExpression(scope);
+                               }
                                this.ts = curTS;
                            
                            
@@ -675,9 +676,9 @@ namespace JSDOC {
                            
                             
                                
-                           case ')': //Token.RP:
-                           case ']': //Token.RB:
-                           case '}': //Token.RB:
+                           case ")": //Token.RP:
+                           case "]": //Token.RB:
+                           case "}": //Token.RB:
                                //print("<< EXIT EXPRESSION");
                                return;
                               
@@ -691,7 +692,7 @@ namespace JSDOC {
                        }
                        break;
                        
-                   case 'STRN': // used for object lit detection..
+                   case "STRN": // used for object lit detection..
                        //if (this.mode == 'BUILDING_SYMBOL_TREE')    
                            //print("EXPR-STR:" + JSON.stringify(token, null, 4));
                   
@@ -700,14 +701,14 @@ namespace JSDOC {
                    
                          
                 
-                   case 'NAME':
-                       if (this.mode == 'BUILDING_SYMBOL_TREE') {
+                   case "NAME":
+                       if (this.mode == ScopeParserMode.BUILDING_SYMBOL_TREE) {
                            
                            //print("EXPR-NAME:" + JSON.stringify(token, null, 4));
                        } else {
                            //print("EXPR-NAME:" + token.toString());
                        }
-                       symbol = token.data;
+                       var symbol = token.data;
                        //print("in NAME = " + token.toString());
                        //print("in NAME 0: " + this.ts.look(0).toString());
                        //print("in NAME 2: " + this.ts.lookTok(2).toString());
@@ -718,13 +719,13 @@ namespace JSDOC {
                            //skip '.'
                            break;
                        }
-                       if (symbol == 'this') {
+                       if (symbol == "this") {
                            break;
-                          }
+                   }
                        
-                       if (this.mode == 'PASS2_SYMBOL_TREE') {
+                       if (this.mode == ScopeParserMode.PASS2_SYMBOL_TREE) {
 
-                           identifier = this.getIdentifier(symbol, scope, token);
+                           var identifier = this.getIdentifier(symbol, scope, token);
                            //println("<B>??</B>");
                            if (identifier == false) {
 
@@ -734,7 +735,7 @@ namespace JSDOC {
                                    // 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 + ' (line:' + token.line + ')', true);
+                                   this.warn("Found an undeclared symbol: " + symbol + " (line:" + token.line + ")", true);
                                    //print("Found an undeclared symbol: " + symbol + ' (line:' + token.line + ')');
                                    //throw "OOPS";
                                } else {
@@ -755,7 +756,7 @@ namespace JSDOC {
                        
                        
                        //println("<B>EID</B>");
-                   case 'KEYW':   
+                   case "KEYW":   
                        //if (this.mode == 'BUILDING_SYMBOL_TREE') 
                        //    print("EXPR-KEYW:" + JSON.stringify(token, null, 4));
                        
@@ -767,8 +768,8 @@ namespace JSDOC {
                        }
                   
                         
-                       symbol = token.data;
-                       if (this.mode == 'BUILDING_SYMBOL_TREE') {
+                       var symbol = token.data;
+                       if (this.mode == ScopeParserMode.BUILDING_SYMBOL_TREE) {
                            
                            if (token.name == "EVAL") {
                                //print(JSON.stringify(token,null,4));
@@ -809,7 +810,7 @@ namespace JSDOC {
            }
            //print("<< EXIT EXPRESSION");
            this.expN--;
-       },
+       }
 
 
        parseCatch : function(scope) {