X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=JSDOC%2FLang.vala;h=4eb8d4bab81fec8d38ef8db2c81a7ebfbeba32a5;hp=705deea3546d1d53bdc0d8d32dafe33b4ee5deb0;hb=HEAD;hpb=9df5eed92df5195550f0b2152969c53d7488cfd9 diff --git a/JSDOC/Lang.vala b/JSDOC/Lang.vala index 705deea..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) { @@ -83,9 +97,17 @@ namespace JSDOC { public bool isSpace (string str) { return this.whitespaceNames.get(str) != null; } - + public bool isSpaceC (char str) { + 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(); @@ -219,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", @@ -227,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]); }