tests/TreeBuilder.vala
[app.Builder.js] / tests / TreeBuilder.vala
index 53d0d6a..1649262 100644 (file)
@@ -1,9 +1,10 @@
 
+// valac TreeBuilder.vala --pkg libvala-0.24 --pkg posix -o /tmp/treebuilder
 
 
 public class TreeBuilder : Vala.CodeVisitor {
        
-       private Vala.CodeContext create_valac_tree () {
+       public Vala.CodeContext create_valac_tree () {
                // init context:
                var context = new Vala.CodeContext ();
                Vala.CodeContext.push (context);
@@ -16,7 +17,7 @@ public class TreeBuilder : Vala.CodeVisitor {
                context.gir_directories = {};
 
                
-               context.basedir = realpath (".");
+               context.basedir = Posix.realpath (".");
                
                context.directory = context.basedir;
                
@@ -33,7 +34,7 @@ public class TreeBuilder : Vala.CodeVisitor {
 
                var source_file = new Vala.SourceFile (context, 
                                Vala.SourceFileType.SOURCE, 
-                               "/home/alan/gitlive/app.Builder/tests/TreeBuilder.vala");
+                               "/home/alan/gitlive/app.Builder.js/tests/TreeBuilder.vala");
 
                //if (source_package == null) {
                //source_package = register_package (new Package (settings.pkg_name, false, null));
@@ -55,7 +56,7 @@ public class TreeBuilder : Vala.CodeVisitor {
                
                Vala.Parser parser = new Vala.Parser ();
                parser.parse (context);
-               gir_parser.parse (context);
+               //gir_parser.parse (context);
                if (context.report.get_errors () > 0) {
                        print("got errors");
                        return context;
@@ -68,6 +69,7 @@ public class TreeBuilder : Vala.CodeVisitor {
                if (context.report.get_errors () > 0) {
                        return context;
                }
+               return context;
        }
 //
        // startpoint:
@@ -79,6 +81,7 @@ int main (string[] args) {
 
        var a = new TreeBuilder();
        a.create_valac_tree();
+       return 0;
 }