X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FLang.vala;h=4eb8d4bab81fec8d38ef8db2c81a7ebfbeba32a5;hb=cc935efc3f7afc2b006802fc8e53ce6f2f49996c;hp=8fff680d0fc76e066168f997faf3036eb28e2796;hpb=30c2588d2d1fd8a31c624a298dceaa28802ce483;p=gnome.introspection-doc-generator diff --git a/JSDOC/Lang.vala b/JSDOC/Lang.vala index 8fff680..4eb8d4b 100644 --- a/JSDOC/Lang.vala +++ b/JSDOC/Lang.vala @@ -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,7 +98,7 @@ namespace JSDOC { return this.whitespaceNames.get(str) != null; } public bool isSpaceC (char str) { - var s = (string)str; + var s = str.to_string(); return this.whitespaceNames.get(s) != null; } @@ -92,7 +106,7 @@ namespace JSDOC { return this.newlineNames.get(str) != null; } public bool isNewlineC (char str) { - var s = (string) str; + var s =str.to_string(); return this.newlineNames.get(s) != null; } public bool isBoolean (string str) { @@ -227,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", @@ -235,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]); }