JSDOC/ScopeParser.js
[gnome.introspection-doc-generator] / JSDOC / ScopeParser.js
index 127a1a9..ead73bc 100644 (file)
@@ -227,7 +227,7 @@ ScopeParser.prototype = {
         if (thisScope) {
             this.scopes.push(scope);
         } else {
-            thisScope = this.scopes[scopes.length-1]
+            thisScope = this.scopes[this.scopes.length-1]
         }
        
         //var scopeIndent = ''; 
@@ -706,14 +706,18 @@ ScopeParser.prototype = {
                       
              
                 case 'NAME':
-                    if (this.mode == 'BUILDING_SYMBOL_TREE') 
+                    if (this.mode == 'BUILDING_SYMBOL_TREE') {
+                        
                         print("EXPR-NAME:" + JSON.stringify(token, null, 4));
+                    } else {
+                        print("EXPR-NAME:" + token.toString());
+                       }
                     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());
                     
-                    //print(this.ts.lookTok(0).data);
+                    print(this.ts.lookTok(0).data);
                     // prefixed with '.'
                     if (this.ts.lookTok(0).data == ".") {
                         //skip '.'
@@ -734,6 +738,8 @@ ScopeParser.prototype = {
                                 // any conflict with other munged symbols.
                                 this.globalScope.declareIdentifier(symbol, token);
                                 this.warn("Found an undeclared symbol: " + symbol + ' (line:' + token.line + ')', true);
+                                print("Found an undeclared symbol: " + symbol + ' (line:' + token.line + ')');
+                                throw "OOPS";
                             } else {
                                 print("undeclared:" + token.toString())
                             }