namespace Palete {
public class ValaSourceReport : Vala.Report {
-
+
+
+
+
+ Gee.HashMap<int,string> line_errors;
+
+ public ValaSourceReport()
+ {
+ this.line_errors = new Gee.HashMap<int,string> ();
+ }
+
public override void err (Vala.SourceReference? source, string message) {
errors++;
if (source == null) {
- stderr.printf ("My error: %s\n", message);
- } else {
- stderr.printf ("%s: My error: %s\n", source.to_string (), message);
-
- //Vala.Report.report_source (source);
-
+ 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);
}
var source_file = new Vala.SourceFile (
context,
Vala.SourceFileType.SOURCE,
+ "~~~~~testfile.vala",
file.toSource()
);
//context.add_source_file (testcode);