tests/forkme.vala
[app.Builder.js] / src / Palete / ValaSource.vala
index 6cf4577..6a87966 100644 (file)
@@ -131,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) {
@@ -139,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();
@@ -255,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;
                                        }       
                         
@@ -307,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);
@@ -320,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;
                        }
 
@@ -332,17 +334,17 @@ 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;
                                
                        }
                        
-                       context.codegen = new Vala.GDBusServerModule ();
+                       //context.codegen = new Vala.GDBusServerModule ();
                        
                         
                        context.output = "/tmp/testbuild";
                        valac += " -o " +context.output;
-                       context.codegen.emit (context);
+                       //context.codegen.emit (context);
                        /*
                        var ccompiler = new Vala.CCodeCompiler ();
                        var cc_command = Environment.get_variable ("CC");
@@ -355,7 +357,11 @@ namespace Palete {
                        */
  
                        Vala.CodeContext.pop ();
-                       this.compile_notice("END", "", 0, "");
+                       //(new Vala.CodeNode()).get_error_types().clear();
+                       //(new Vala.NullType()).get_type_arguments().clear();
+                       (new Vala.NullType(null)).get_type_arguments().clear();
+                       parser = null;
+                       this.report.compile_notice("END", "", 0, "");
                        print("%s\n", valac);
                        print("ALL OK?\n");
                        return this.report.line_errors;