- private Vala.CodeContext create_valac_tree (Settings settings) {
- // init context:
- var context = new Vala.CodeContext ();
- Vala.CodeContext.push (context);
-
- context.experimental = false;
- context.experimental_non_null = false;
- context.vapi_directories = { "/usr/share/vala-0.24/vapi" };
- context.report.enable_warnings = true;
- context.metadata_directories = { };
- context.gir_directories = {};
-
- if (settings.basedir == null) {
- context.basedir = realpath (".");
- } else {
- context.basedir = realpath (settings.basedir);
+ public class ValaSourceReport : Vala.Report {
+
+
+
+
+ Gee.HashMap<int,string> line_errors;
+
+ public ValaSourceReport()
+ {
+ base();
+ this.line_errors = new Gee.HashMap<int,string> ();
+ }
+
+ public override void err (Vala.SourceReference? source, string message) {
+ errors++;
+ if (source == null) {
+ return;
+ //stderr.printf ("My error: %s\n", message);
+ }
+ if (source.file != "~~~~~testfile.vala") {
+ return;
+ }
+ var pre = "";
+ if (line_errors.has_key(source.begin.line)) {
+ pre = line_errors.get(source.begin.line) + "\n";
+
+ }
+ line_errors.set(source.begin.line, pre + message);