JSDOC/ScopeParser.vala
[gnome.introspection-doc-generator] / JSDOC / ScopeParser.vala
index 9d4a43d..cfbe82f 100644 (file)
@@ -24,7 +24,7 @@ namespace JSDOC {
     Gee.HashMap<int,Scope> indexedScopes;
     bool munge =  true;
 
-       
+    int expN =  0;     
        
        public ScopeParser(TokenStream ts) {
                this.ts = ts; // {TokenStream}
@@ -252,7 +252,7 @@ namespace JSDOC {
                         //this.logR("parseScope GOT VAR  : <B>" + token.toString() + "</B>"); 
                         if (token.type != "NAME") {
                                
-                            for(var i = Int.max(this.ts.cursor-10,0); i < this.ts.cursor+1; i++) {
+                            for(var i = int.max(this.ts.cursor-10,0); i < this.ts.cursor+1; i++) {
                                 print(this.ts.tokens[i].toString());
                             }
                             
@@ -462,7 +462,8 @@ namespace JSDOC {
                     if (symbol == "this") {
                         break;
                     }
-                    if (this.mode == 'PASS2_SYMBOL_TREE') {
+                    
+                    if (this.mode == ScopeParserMode.PASS2_SYMBOL_TREE) {
                         
                         //println("GOT IDENT: -2 : " + this.ts.lookT(-2).toString() + " <BR> ..... -1 :  " +  this.ts.lookT(-1).toString() + " <BR> "); 
                         
@@ -481,7 +482,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);
                             }
                             
                             //println("GOT IDENT IGNORE(3): <B>" + symbol + "</B><BR/>");
@@ -494,7 +495,7 @@ namespace JSDOC {
                     break;
                     //println("<B>SID</B>");
                 default:
-                    if (token.type != 'KEYW') {
+                    if (token.type != "KEYW") {
                         break;
                     }
                     //print('SCOPE-KEYW:' + token.toString());
@@ -502,7 +503,7 @@ namespace JSDOC {
                 
                     symbol = token.data;
                     
-                     if (this.mode == 'BUILDING_SYMBOL_TREE') {
+                     if (this.mode == ScopeParserMode.BUILDING_SYMBOL_TREE) {
 
                         if (token.name == "EVAL") {
                             
@@ -513,6 +514,8 @@ namespace JSDOC {
                                 // look for eval:var:noreplace\n
                                 //print("MATCH!?");
                                 var _t = this;
+                                
+                                
                                 token.prefix.replace(/eval:var:([a-z_]+)/ig, function(m, a) {
                                     //print("GOT: " + a);
                                     var hi = _t.getIdentifier(a, scope, token);
@@ -549,9 +552,10 @@ namespace JSDOC {
         }
         //print("<<< EXIT SCOPE");
         //print("<<<<<<<EXIT SCOPE ERR?" +this.scopes.length);
-    },
+    }
 
-    expN : 0,
+
+    
     parseExpression : function(scope) {
 
         // Parse the expression until we encounter a comma or a semi-colon