-// valac TreeBuilder.vala --pkg libvala-0.24 --pkg posix -o /tmp/treebuilder
+// valac TestCompiler.vala --pkg libvala-0.26 --pkg posix -o /tmp/TestCompiler
namespace Palete {
- public Gee.HashMap<int,string> checkString( )
+ public void checkString( )
{
// init context:
var valac = "valac " ;
context.thread = true;
- this.report = new ValaSourceReport(this.file);
- context.report = this.report;
-
+
context.basedir = "/tmp"; //Posix.realpath (".");
context.add_external_package ("gtksourceview-3.0");
context.add_external_package ("libvala-0.26");
// user defined ones..
-
- var dcg = pr.compilegroups.get("_default_");
- for (var i = 0; i < dcg.packages.size; i++) {
- valac += " --pkg " + dcg.packages.get(i);
- context.add_external_package (dcg.packages.get(i));
- }
+
//Vala.Config.PACKAGE_SUFFIX.substring (1)
//context.add_external_package ("libvala-0.24");
- this.report.compile_notice("START", "", 0, "");
-
+
//add_documented_files (context, settings.source_files);
//gir_parser.parse (context);
if (context.report.get_errors () > 0) {
print("parse got errors");
- ((ValaSourceReport)context.report).dump();
-
+
Vala.CodeContext.pop ();
- this.report.compile_notice("END", "", 0, "");
+
return this.report.line_errors;
}
// check context:
context.check ();
if (context.report.get_errors () > 0) {
- print("check got errors");
- ((ValaSourceReport)context.report).dump();
- Vala.CodeContext.pop ();
- this.report.compile_notice("END", "", 0, "");
+ Vala.CodeContext.pop ();
+
return this.report.line_errors;
}
Vala.CodeContext.pop ();
//(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;
+ return ;
}
//
// startpoint:
}
}
-/*
+
int main (string[] args) {
- var a = new ValaSource(file);
- a.create_valac_tree();
+ for (var i = 0;i < 1000;i++) {
+ var a = new TestCompiler(file);
+ a.compileString();
+ }
return 0;
}
-*/
+