JSDOC/ScopeParser.vala
authorAlan Knowles <alan@roojs.com>
Mon, 9 Nov 2015 10:07:08 +0000 (18:07 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 9 Nov 2015 10:07:08 +0000 (18:07 +0800)
JSDOC/ScopeParser.vala

index a59024a..37a2a1d 100644 (file)
@@ -434,7 +434,7 @@ namespace JSDOC {
                            // should do a bit more checking!!!! (what about wierd char's in the string..
                            var str = token.data.substring(1,token.data.length-1);
                            
-                           if (Regex.match_simple ("^[a-z_]+$", str) && this.idents.index_of(str) < 0) {
+                           if (Regex.match_simple ("^[a-z_]+$", str,GLib.RegexCompileFlags.CASELESS) && this.idents.index_of(str) < 0) {
                                token.outData = str;
                            }
                            
@@ -773,8 +773,16 @@ namespace JSDOC {
                        if (this.mode == ScopeParserMode.BUILDING_SYMBOL_TREE) {
                            
                            if (token.name == "EVAL") {
+                           
+                            Regex.match_simple ("s[ai]mple", "This is a simple sample.",GLib.RegexCompileFlags.CASELESS);
+                             var regex = new GLib.Regex ("eval:var:([a-z_]+)",GLib.RegexCompileFlags.CASELESS );
+                                   regex.replace_eval (token.prefix, token.prefix.length, 0, 0, (match_info, result) => {
+                       
+                           
                                //print(JSON.stringify(token,null,4));
-                               if (token.prefix && token.prefix.match(/eval:var:/g)) {
+                               
+                               if (token.prefix.length > 0 && token.prefix.match(/eval:var:/g)) {
                                    // look for eval:var:noreplace\n
                                   // print("GOT MATCH?");
                                    var _t = this;