JSDOC/ScopeParser.vala
[gnome.introspection-doc-generator] / JSDOC / ScopeParser.vala
index 96cc63d..73ee2bf 100644 (file)
@@ -273,7 +273,7 @@ namespace JSDOC {
                         }
 
                         token = this.ts.nextTok();
-                        !this.debug|| print(token.toString());
+                        //!this.debug|| print(token.toString());
                         /*
                         assert token.getType() == Token.SEMI ||
                                 token.getType() == Token.ASSIGN ||
@@ -285,15 +285,15 @@ namespace JSDOC {
                         } else {
                             //var bn = this.braceNesting;
                             var bn = this.braceNesting;
-                            var nts = [];
+                            var nts = new Gee.ArrayList<Token>();
                             while (true) {
-                                if (!token || token.type == 'VOID' || token.data == ',') {
+                                if (!token || token.type == "VOID" || token.data == ",") {
                                     break;
                                 }
-                                nts.push(token);
+                                nts.add(token);
                                 token = this.ts.nextTok();
                             }
-                            if (nts.length) {
+                            if (nts.size > 0) {
                                 var TS = this.ts;
                                 this.ts = new TokenStream(nts);
                                 this.parseExpression(scope);
@@ -307,7 +307,7 @@ namespace JSDOC {
                             token = this.ts.lookTok(1);
                             //!this.debug|| 
                            // print("AFTER EXP: " + token.toString());
-                            if (token.data == ';') {
+                            if (token.data == ";") {
                                 break;
                             }
                         }
@@ -334,17 +334,20 @@ namespace JSDOC {
                     //print('SCOPE-CURLY/PAREN:' + token.toString());
                     //println("<i>"+token.data+"</i>");
                     var curTS = this.ts;
-                    if (token.props) {
+                    if (token.props.size() > 0) {
                         
                         // { a : ... , c : .... }
+                        var iter = token.props.map_iterator();
                         
-                        for (var prop in token.props) {
+                        while(iter.next()) {
+                               
+                            TokenKeyMap val = iter.get_value(); // TokenKeyMap
                             
                             
                           //  print('SCOPE-PROPS:' + JSON.stringify(token.props[prop],null,4));
-                            if (token.props[prop].val[0].data == 'function') {
+                            if (val.vals.get(0).data == "function") {
                                 // parse a function..
-                                this.ts = new TokenStream(token.props[prop].val);
+                                this.ts = new TokenStream(val.vals);
                                 this.ts.nextTok();
                                 this.parseFunctionDeclaration(scope);
                                 
@@ -352,7 +355,7 @@ namespace JSDOC {
                             }
                             // key value..
                             
-                            this.ts = new TokenStream(token.props[prop].val);
+                            this.ts = new TokenStream(val.vals);
                             this.parseExpression(scope);
                             
                         }