JSDOC/ScopeParser.vala
[gnome.introspection-doc-generator] / JSDOC / ScopeParser.vala
index bab64ae..a6c181b 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());
                             }
                             
@@ -554,36 +554,35 @@ namespace JSDOC {
         //print("<<<<<<<EXIT SCOPE ERR?" +this.scopes.length);
     }
 
-    expN : 0,
-    parseExpression : function(scope) {
+
+    
+    void parseExpression(Scope scope) 
+    {
 
         // Parse the expression until we encounter a comma or a semi-colon
         // in the same brace nesting, bracket nesting and paren nesting.
         // Parse functions if any...
         //println("<i>EXP</i><BR/>");
-        !this.debug || print("PARSE EXPR");
+        //!this.debug || print("PARSE EXPR");
         this.expN++;
          
         // for printing stuff..
        
         
         
-        var symbol;
-        var token;
-        
-        var identifier;
 
         var expressionBraceNesting = this.braceNesting + 0;
         var bracketNesting = 0;
         var parensNesting = 0;
         var isInObjectLitAr;
-        var isObjectLitAr = [ false ];
+        var isObjectLitAr = new Gee.ArrayList<boolean>();
+        isObjectLitAr.add( false);
         
         
             
         
         //print(scopeIndent + ">> ENTER EXPRESSION" + this.expN);
-        while ((token = this.ts.nextTok())) {
+        while (null != (token = this.ts.nextTok())) {
      
         
             
@@ -604,23 +603,23 @@ namespace JSDOC {
             //println("<i>"+token.data+"</i>");
             //this.log("EXP:" + token.data);
             switch (token.type) {
-                case 'PUNC':
+                case "PUNC":
                     //print("EXPR-PUNC:" + token.toString());
                     
                     switch(token.data) {
                          
-                        case ';':
+                        case ";":
                             //print("<< EXIT EXPRESSION");
                             break;
 
-                        case ',':
+                        case ",":
                             
                             break;
 
                        
-                        case '(': //Token.LP:
-                        case '{': //Token.LC:
-                        case '[': //Token.LB:
+                        case "(": //Token.LP:
+                        case "{": //Token.LC:
+                        case "[": //Token.LB:
                             //print('SCOPE-CURLY/PAREN/BRACE:' + token.toString());
                            // print('SCOPE-CURLY/PAREN/BRACE:' + JSON.stringify(token, null,4));
                             //println("<i>"+token.data+"</i>");