namespace Palete {
+ /*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 {
-
+ public JsRender.JsRender file;
-
+ //public Gee.ArrayList<ValaSourceNotice> notices;
+
public Gee.HashMap<int,string> line_errors;
-
- public ValaSourceReport()
+
+
+ public ValaSourceReport(JsRender.JsRender file)
{
base();
+ this.file = file;
this.line_errors = new Gee.HashMap<int,string> ();
+ //this.notices = new Gee.ArrayList<ValaSourceNotice>();
}
public override void warn (Vala.SourceReference? source, string message) {
- errors++;
+
if (source == null) {
return;
//stderr.printf ("My error: %s\n", message);
}
+
if (source.file.filename != "~~~~~testfile.vala") {
- print ("Warning: %d: %s\n", source.begin.line, message);
+ this.file.compile_notice("WARN", source.file.filename , source.begin.line, message);
return;
}
- var pre = "";
- if (line_errors.has_key(source.begin.line)) {
- pre = line_errors.get(source.begin.line) + "\n";
-
+ this.file.compile_notice("WARN", this.file.path, source.begin.line, message);
+
+ }
+ public override void depr (Vala.SourceReference? source, string message) {
+
+ if (source == null) {
+ return;
+ //stderr.printf ("My error: %s\n", message);
}
- line_errors.set(source.begin.line, pre + message);
- print ("Test file: Got error error: %d: %s\n", source.begin.line, message);
+
+ if (source.file.filename != "~~~~~testfile.vala") {
+ this.file.compile_notice("DEPR", source.file.filename, source.begin.line, message);
+ return;
+ }
+ this.file.compile_notice("DEPR", this.file.path, source.begin.line, message);
+
}
-
public override void err (Vala.SourceReference? source, string message) {
errors++;
if (source == null) {
//stderr.printf ("My error: %s\n", message);
}
if (source.file.filename != "~~~~~testfile.vala") {
+ this.file.compile_notice("ERR", source.file.filename, source.begin.line, message);
print ("Other file: Got error error: %d: %s\n", source.begin.line, message);
return;
}
}
line_errors.set(source.begin.line, pre + message);
+ this.file.compile_notice("ERR", this.file.path, source.begin.line, message);
print ("Test file: Got error error: %d: %s\n", source.begin.line, message);
}
public void dump()
context.thread = true;
- this.report = new ValaSourceReport();;
+ this.report = new ValaSourceReport(this.file);
context.report = this.report;
- context.basedir = Posix.realpath (".");
+ context.basedir = "/tmp"; //Posix.realpath (".");
context.directory = context.basedir;
//context.add_external_package ("libvala-0.24");
-
+ this.file.compile_notice("START", "", 0, "");
//add_documented_files (context, settings.source_files);
if (context.report.get_errors () > 0) {
print("parse got errors");
((ValaSourceReport)context.report).dump();
+
Vala.CodeContext.pop ();
+ this.file.compile_notice("END", "", 0, "");
return this.report.line_errors;
}
print("check got errors");
((ValaSourceReport)context.report).dump();
Vala.CodeContext.pop ();
+ this.file.compile_notice("END", "", 0, "");
return this.report.line_errors;
}
#else
ccompiler.compile (context, cc_command, new string[] { });
#endif
-
-*/
+ */
+
Vala.CodeContext.pop ();
+ this.file.compile_notice("END", "", 0, "");
print("%s\n", valac);
print("ALL OK?\n");
return this.report.line_errors;