tests/TreeBuilder.vala
[app.Builder.js] / tests / TreeBuilder.vala
index 2e97b5d..cad25db 100644 (file)
@@ -3,14 +3,21 @@
 
 namespace Palete {
        
-       public class MyReport  : Vala.Report {
-       
+       public class ValaSourceReport  : Vala.Report {
+
+
+               Gee.HashMap<int,string> line_errors;
+               
                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);
+                               return;
+                               //stderr.printf ("My error: %s\n", message);
+                       }
+                       if (source.
+                       var line = source.begin.line;
+                       
+                       stderr.printf ("%s: My error: %s\n", source.to_string (), message);
                
                                //Vala.Report.report_source (source);
                        
@@ -20,7 +27,7 @@ namespace Palete {
 
        }
 
-       public class TreeBuilder : Vala.CodeVisitor {
+       public class ValaSource : Vala.CodeVisitor {
        
                public Vala.CodeContext check (JsRender.Gtk file) {
                        // init context:
@@ -36,7 +43,7 @@ namespace Palete {
                        context.report.enable_warnings = true;
                        context.metadata_directories = { };
                        context.gir_directories = {};
-                       context.report = new MyReport();
+                       context.report = new ValaSourceReport();
                
                        context.basedir = Posix.realpath (".");
                
@@ -56,6 +63,7 @@ namespace Palete {
                        var source_file = new Vala.SourceFile (
                                context, 
                                Vala.SourceFileType.SOURCE, 
+                                "~~~~~testfile.vala",
                               file.toSource()
                        );
                        //context.add_source_file (testcode);