sync
[app.Builder.js] / src / Palete / ValaSource.vala
index e1bdd04..b171698 100644 (file)
@@ -2,20 +2,7 @@
 // valac TreeBuilder.vala --pkg libvala-0.24 --pkg posix -o /tmp/treebuilder
 
 namespace Palete {
-       1
-       /*public class ValaSourceNotice  : Object {
-               public string file;
-               public int line;
-               public string message;
-               public string type;
-               public ValaSourceNotice( string type, string file, int line, string message) {
-                       this.file =f ;
-                       this.line =l;
-                       this.type =t;
-                       this.message = m;
-               }
-       }
-       */
+        
        
        public class ValaSourceReport  : Vala.Report {
 
@@ -25,9 +12,9 @@ namespace Palete {
                 
                public Gee.HashMap<int,string> line_errors;
                
-               public void  compile_notice(string type, string file, int line, string message) {
+               public void  compile_notice(string type, string filename, int line, string message) {
                        GLib.Idle.add(() => {
-                               this.file.compile_notice(type,file,line,message);
+                               this.file.compile_notice(type,filename,line,message);
                                return false;
                        });
                }
@@ -144,6 +131,8 @@ namespace Palete {
                        
                        hash.set(prop, newval);
                        var tmpstring = JsRender.NodeToVala.mungeFile(this.file);
+                       hash.set(prop, old);
+                       //print("%s\n", tmpstring);
                        var bits = tmpstring.split("/*--VALACHECK-START--*/");
                        var offset =0;
                        if (bits.length > 0) {
@@ -152,7 +141,7 @@ namespace Palete {
                        //this.dumpCode(tmpstring);
                        //print("offset %d\n", offset);
                        yield this.checkStringThread(tmpstring);
-                       hash.set(prop, old);
+                       
                        // modify report
                        
                        var iter = this.report.line_errors.map_iterator();
@@ -268,9 +257,9 @@ namespace Palete {
                                var cg =  pr.compilegroups.get(this.file.build_module);
                                for (var i = 0; i < cg.sources.size; i++) {
                                        var path = pr.resolve_path(
-                               pr.resolve_path_combine_path(pr.firstPath(),cg.sources.get(i)));
-                               
-                       if (!FileUtils.test(path, FileTest.EXISTS)) {
+                                                       pr.resolve_path_combine_path(pr.firstPath(),cg.sources.get(i)));
+                                                       
+                                       if (!FileUtils.test(path, FileTest.EXISTS)) {
                                                continue;
                                        }       
                         
@@ -320,7 +309,7 @@ namespace Palete {
                        
                        //context.add_external_package ("libvala-0.24");
                        
-                       this.compile_notice("START", "", 0, "");
+                       this.report.compile_notice("START", "", 0, "");
 
                
                        //add_documented_files (context, settings.source_files);
@@ -333,7 +322,7 @@ namespace Palete {
                                ((ValaSourceReport)context.report).dump();
                                
                                Vala.CodeContext.pop ();
-                               this.compile_notice("END", "", 0, "");
+                               this.report.compile_notice("END", "", 0, "");
                                return this.report.line_errors;
                        }
 
@@ -345,7 +334,7 @@ namespace Palete {
                                print("check got errors");
                                ((ValaSourceReport)context.report).dump();
                                Vala.CodeContext.pop ();
-                               this.compile_notice("END", "", 0, "");
+                               this.report.compile_notice("END", "", 0, "");
                                return this.report.line_errors;
                                
                        }
@@ -368,7 +357,7 @@ namespace Palete {
                        */
  
                        Vala.CodeContext.pop ();
-                       this.compile_notice("END", "", 0, "");
+                       this.report.compile_notice("END", "", 0, "");
                        print("%s\n", valac);
                        print("ALL OK?\n");
                        return this.report.line_errors;