JSDOC/TokenReader.js
[gnome.introspection-doc-generator] / JSDOC / Lang.vala
index ff65f5d..4eb8d4b 100644 (file)
@@ -38,6 +38,7 @@ namespace JSDOC {
             this.init();
             //print("init Lang");
             Lang = this;
+            Lang.ref();
             
         }
         
@@ -56,8 +57,21 @@ namespace JSDOC {
             return this.keywordNames.get("="+word);
         }
         
-        public string matching(string name) {
-            return this.matchingNames.get(name);
+        public string? matching(string name) {
+        
+            
+            switch(name) {
+                               case   "LEFT_PAREN": return "RIGHT_PAREN";
+               case "RIGHT_PAREN": return "LEFT_PAREN";
+               case "LEFT_CURLY": return "RIGHT_CURLY";
+               case "RIGHT_CURLY": return "LEFT_CURLY";
+               case "LEFT_BRACE": return "RIGHT_BRACE";
+               case "RIGHT_BRACE": return "LEFT_BRACE";
+               default:
+                               return null;
+           };
+        
+            //return this.matchingNames.get(name);
         }
         
         public bool isKeyword(string word) {
@@ -84,10 +98,16 @@ namespace JSDOC {
             return this.whitespaceNames.get(str) != null;
         }
            public bool isSpaceC (char str) {
-            return this.whitespaceNames.get("" + str) != null;
+                       var s = str.to_string();
+            return this.whitespaceNames.get(s) != null;
         }
+        
         public bool isNewline (string str) {
             return this.newlineNames.get(str) != null;
+               }          
+        public bool isNewlineC (char str) {
+               var s =str.to_string();
+            return this.newlineNames.get(s) != null;
         }
            public bool isBoolean (string str) {
                        var ss = str.down();
@@ -221,7 +241,7 @@ namespace JSDOC {
                 this.puncNames.set(x[0],x[1]);
             }
         
-           ws = {
+           string[] wsp = {
                "LEFT_PAREN:RIGHT_PAREN",
                "RIGHT_PAREN:LEFT_PAREN",
                "LEFT_CURLY:RIGHT_CURLY",
@@ -229,8 +249,8 @@ namespace JSDOC {
                "LEFT_BRACE:RIGHT_BRACE",
                "RIGHT_BRACE:LEFT_BRACE"
            };
-           for(var i =0; i< ws.length;i++ ) {
-               var x = ws[i].split(":");
+           for(var i =0; i< wsp.length;i++ ) {
+               var x = wsp[i].split(":");
                this.matchingNames.set(x[0],x[1]);
            }