From 57dc91298444e137bd937ce35b00e33d7387c370 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Tue, 12 Jun 2018 10:02:25 +0200 Subject: libvaladoc: Replace void* with corresponding Vala API --- libvaladoc/api/array.vala | 2 +- libvaladoc/api/attribute.vala | 10 +++++----- libvaladoc/api/attributeargument.vala | 10 +++++----- libvaladoc/api/class.vala | 2 +- libvaladoc/api/constant.vala | 2 +- libvaladoc/api/delegate.vala | 2 +- libvaladoc/api/enum.vala | 2 +- libvaladoc/api/enumvalue.vala | 2 +- libvaladoc/api/errorcode.vala | 2 +- libvaladoc/api/errordomain.vala | 2 +- libvaladoc/api/field.vala | 2 +- libvaladoc/api/formalparameter.vala | 2 +- libvaladoc/api/interface.vala | 2 +- libvaladoc/api/item.vala | 4 ++-- libvaladoc/api/member.vala | 2 +- libvaladoc/api/method.vala | 2 +- libvaladoc/api/namespace.vala | 2 +- libvaladoc/api/node.vala | 2 +- libvaladoc/api/package.vala | 2 +- libvaladoc/api/pointer.vala | 2 +- libvaladoc/api/property.vala | 2 +- libvaladoc/api/propertyaccessor.vala | 2 +- libvaladoc/api/signal.vala | 2 +- libvaladoc/api/sourcefile.vala | 4 ++-- libvaladoc/api/struct.vala | 2 +- libvaladoc/api/symbol.vala | 2 +- libvaladoc/api/tree.vala | 6 +++--- libvaladoc/api/typeparameter.vala | 2 +- libvaladoc/api/typereference.vala | 2 +- libvaladoc/api/typesymbol.vala | 2 +- valadoc/driver.vala | 2 +- valadoc/treebuilder.vala | 34 +++++++++++----------------------- 32 files changed, 54 insertions(+), 66 deletions(-) diff --git a/libvaladoc/api/array.vala b/libvaladoc/api/array.vala index 8e3cbe5fb..ef24b1f6e 100644 --- a/libvaladoc/api/array.vala +++ b/libvaladoc/api/array.vala @@ -36,7 +36,7 @@ public class Valadoc.Api.Array : Item { get; } - public Array (Item parent, void* data) { + public Array (Item parent, Vala.ArrayType data) { base (data); this.parent = parent; diff --git a/libvaladoc/api/attribute.vala b/libvaladoc/api/attribute.vala index e138389be..b80a1b52c 100644 --- a/libvaladoc/api/attribute.vala +++ b/libvaladoc/api/attribute.vala @@ -32,7 +32,7 @@ public class Valadoc.Api.Attribute : Item { get; } - public Attribute (Node parent, SourceFile file, string name, void* data) { + public Attribute (Node parent, SourceFile file, string name, Vala.Attribute data) { base (data); this.parent = parent; @@ -52,25 +52,25 @@ public class Valadoc.Api.Attribute : Item { return null; } - public AttributeArgument add_boolean (string name, bool value, void* data = null) { + public AttributeArgument add_boolean (string name, bool value, Vala.Attribute data) { AttributeArgument arg = new AttributeArgument.boolean (this, file, name, value, data); args.add (arg); return arg; } - public AttributeArgument add_integer (string name, int value, void* data = null) { + public AttributeArgument add_integer (string name, int value, Vala.Attribute data) { AttributeArgument arg = new AttributeArgument.integer (this, file, name, value, data); args.add (arg); return arg; } - public AttributeArgument add_double (string name, double value, void* data = null) { + public AttributeArgument add_double (string name, double value, Vala.Attribute data) { AttributeArgument arg = new AttributeArgument.double (this, file, name, value, data); args.add (arg); return arg; } - public AttributeArgument add_string (string name, string value, void* data = null) { + public AttributeArgument add_string (string name, string value, Vala.Attribute data) { AttributeArgument arg = new AttributeArgument.string (this, file, name, value, data); args.add (arg); return arg; diff --git a/libvaladoc/api/attributeargument.vala b/libvaladoc/api/attributeargument.vala index 1a3b01fab..374b3d6fc 100644 --- a/libvaladoc/api/attributeargument.vala +++ b/libvaladoc/api/attributeargument.vala @@ -48,23 +48,23 @@ public class Valadoc.Api.AttributeArgument : Item { get; } - public AttributeArgument.boolean (Attribute parent, SourceFile file, string name, bool value, void* data) { + public AttributeArgument.boolean (Attribute parent, SourceFile file, string name, bool value, Vala.Attribute data) { this (parent, file, name, Type.BOOLEAN, value.to_string (), data); } - public AttributeArgument.integer (Attribute parent, SourceFile file, string name, int value, void* data) { + public AttributeArgument.integer (Attribute parent, SourceFile file, string name, int value, Vala.Attribute data) { this (parent, file, name, Type.INTEGER, value.to_string (), data); } - public AttributeArgument.double (Attribute parent, SourceFile file, string name, double value, void* data) { + public AttributeArgument.double (Attribute parent, SourceFile file, string name, double value, Vala.Attribute data) { this (parent, file, name, Type.DOUBLE, value.to_string (), data); } - public AttributeArgument.string (Attribute parent, SourceFile file, string name, string value, void* data) { + public AttributeArgument.string (Attribute parent, SourceFile file, string name, string value, Vala.Attribute data) { this (parent, file, name, Type.STRING, value, data); } - private AttributeArgument (Attribute parent, SourceFile file, string name, Type type, string value, void* data) { + private AttributeArgument (Attribute parent, SourceFile file, string name, Type type, string value, Vala.Attribute data) { base (data); this.argument_type = type; diff --git a/libvaladoc/api/class.vala b/libvaladoc/api/class.vala index 4ef99ea14..47781c959 100644 --- a/libvaladoc/api/class.vala +++ b/libvaladoc/api/class.vala @@ -52,7 +52,7 @@ public class Valadoc.Api.Class : TypeSymbol { string? dbus_name, string? type_id, string? param_spec_function_name, string? ref_function_name, string? unref_function_name, string? free_function_name, string? finalize_function_name, string? take_value_function_cname, string? get_value_function_cname, string? set_value_function_cname, - bool is_fundamental, bool is_abstract, bool is_basic_type, void* data) + bool is_fundamental, bool is_abstract, bool is_basic_type, Vala.Class data) { base (parent, file, name, accessibility, comment, type_macro_name, is_type_macro_name, type_cast_macro_name, type_function_name, is_basic_type, data); diff --git a/libvaladoc/api/constant.vala b/libvaladoc/api/constant.vala index 0ff79f261..d9d3f475d 100644 --- a/libvaladoc/api/constant.vala +++ b/libvaladoc/api/constant.vala @@ -38,7 +38,7 @@ public class Valadoc.Api.Constant : Member { } public Constant (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, - SourceComment? comment, string? cname, void* data) + SourceComment? comment, string? cname, Vala.Constant data) { base (parent, file, name, accessibility, comment, data); diff --git a/libvaladoc/api/delegate.vala b/libvaladoc/api/delegate.vala index 9db4d9f10..d7afcb17e 100644 --- a/libvaladoc/api/delegate.vala +++ b/libvaladoc/api/delegate.vala @@ -40,7 +40,7 @@ public class Valadoc.Api.Delegate : TypeSymbol, Callable { public Delegate (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, - SourceComment? comment, string? cname, bool is_static, void* data) + SourceComment? comment, string? cname, bool is_static, Vala.Delegate data) { base (parent, file, name, accessibility, comment, null, null, null, null, false, data); diff --git a/libvaladoc/api/enum.vala b/libvaladoc/api/enum.vala index cbadb1971..6774b5c84 100644 --- a/libvaladoc/api/enum.vala +++ b/libvaladoc/api/enum.vala @@ -31,7 +31,7 @@ public class Valadoc.Api.Enum : TypeSymbol { public Enum (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? type_macro_name, - string? type_function_name, void* data) + string? type_function_name, Vala.Enum data) { base (parent, file, name, accessibility, comment, type_macro_name, null, null, type_function_name, false, data); diff --git a/libvaladoc/api/enumvalue.vala b/libvaladoc/api/enumvalue.vala index e3ec568b9..55702e1df 100644 --- a/libvaladoc/api/enumvalue.vala +++ b/libvaladoc/api/enumvalue.vala @@ -44,7 +44,7 @@ public class Valadoc.Api.EnumValue: Symbol { } } - public EnumValue (Enum parent, SourceFile file, string name, SourceComment? comment, string? cname, void* data) { + public EnumValue (Enum parent, SourceFile file, string name, SourceComment? comment, string? cname, Vala.EnumValue data) { base (parent, file, name, parent.accessibility, data); this.source_comment = comment; diff --git a/libvaladoc/api/errorcode.vala b/libvaladoc/api/errorcode.vala index 2d10fb6a1..64f169357 100644 --- a/libvaladoc/api/errorcode.vala +++ b/libvaladoc/api/errorcode.vala @@ -32,7 +32,7 @@ public class Valadoc.Api.ErrorCode : Symbol { private string? cname; public ErrorCode (ErrorDomain parent, SourceFile file, string name, SourceComment? comment, - string? cname, string? dbus_name, void* data) + string? cname, string? dbus_name, Vala.ErrorCode data) { base (parent, file, name, parent.accessibility, data); diff --git a/libvaladoc/api/errordomain.vala b/libvaladoc/api/errordomain.vala index c469bf3a8..80b16bb7f 100644 --- a/libvaladoc/api/errordomain.vala +++ b/libvaladoc/api/errordomain.vala @@ -34,7 +34,7 @@ public class Valadoc.Api.ErrorDomain : TypeSymbol { public ErrorDomain (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? quark_macro_name, - string? quark_function_name, string? dbus_name, void* data) + string? quark_function_name, string? dbus_name, Vala.ErrorDomain data) { base (parent, file, name, accessibility, comment, null, null, null, null, false, data); diff --git a/libvaladoc/api/field.vala b/libvaladoc/api/field.vala index 2844faa5f..baf58a94f 100644 --- a/libvaladoc/api/field.vala +++ b/libvaladoc/api/field.vala @@ -31,7 +31,7 @@ public class Valadoc.Api.Field : Member { public Field (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, bool is_static, bool is_volatile, - void* data) + Vala.Field data) { base (parent, file, name, accessibility, comment, data); diff --git a/libvaladoc/api/formalparameter.vala b/libvaladoc/api/formalparameter.vala index f22b5bc39..6bbbc37df 100644 --- a/libvaladoc/api/formalparameter.vala +++ b/libvaladoc/api/formalparameter.vala @@ -58,7 +58,7 @@ public class Valadoc.Api.FormalParameter : Symbol { private FormalParameterType type; - public FormalParameter (Node parent, SourceFile file, string? name, SymbolAccessibility accessibility, FormalParameterType type, bool ellipsis, void* data) { + public FormalParameter (Node parent, SourceFile file, string? name, SymbolAccessibility accessibility, FormalParameterType type, bool ellipsis, Vala.Parameter data) { base (parent, file, name, accessibility, data); assert ((name == null && ellipsis) || (name != null && !ellipsis)); diff --git a/libvaladoc/api/interface.vala b/libvaladoc/api/interface.vala index ede696cf9..a9cc860a9 100644 --- a/libvaladoc/api/interface.vala +++ b/libvaladoc/api/interface.vala @@ -35,7 +35,7 @@ public class Valadoc.Api.Interface : TypeSymbol { public Interface (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? type_macro_name, string? is_type_macro_name, string? type_cast_macro_name, string? type_function_name, string interface_macro_name, - string? dbus_name, void* data) + string? dbus_name, Vala.Interface data) { base (parent, file, name, accessibility, comment, type_macro_name, is_type_macro_name, type_cast_macro_name, type_function_name, false, data); diff --git a/libvaladoc/api/item.vala b/libvaladoc/api/item.vala index 60967a7c1..69bec622a 100644 --- a/libvaladoc/api/item.vala +++ b/libvaladoc/api/item.vala @@ -29,7 +29,7 @@ using Valadoc.Content; public abstract class Valadoc.Api.Item : Object { private Inline _signature; - public void* data { + public Vala.CodeNode? data { private set; get; } @@ -42,7 +42,7 @@ public abstract class Valadoc.Api.Item : Object { get; } - public Item (void* data) { + public Item (Vala.CodeNode? data) { this.data = data; } diff --git a/libvaladoc/api/member.vala b/libvaladoc/api/member.vala index fcabbea6b..a812fc0ab 100644 --- a/libvaladoc/api/member.vala +++ b/libvaladoc/api/member.vala @@ -26,7 +26,7 @@ public abstract class Valadoc.Api.Member : Symbol { private SourceComment? source_comment; public Member (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, - SourceComment? comment, void* data) + SourceComment? comment, Vala.Symbol data) { base (parent, file, name, accessibility, data); diff --git a/libvaladoc/api/method.vala b/libvaladoc/api/method.vala index bccbac5fb..9c12c8f16 100644 --- a/libvaladoc/api/method.vala +++ b/libvaladoc/api/method.vala @@ -46,7 +46,7 @@ public class Valadoc.Api.Method : Member, Callable { public Method (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? dbus_name, string? dbus_result_name, string? finish_function_cname, MethodBindingType binding_type, bool is_yields, - bool is_dbus_visible, bool is_constructor, void* data) + bool is_dbus_visible, bool is_constructor, Vala.Method data) { base (parent, file, name, accessibility, comment, data); diff --git a/libvaladoc/api/namespace.vala b/libvaladoc/api/namespace.vala index 7e3516605..c441782ca 100644 --- a/libvaladoc/api/namespace.vala +++ b/libvaladoc/api/namespace.vala @@ -29,7 +29,7 @@ using Valadoc.Content; public class Valadoc.Api.Namespace : Symbol { private SourceComment? source_comment; - public Namespace (Api.Node parent, SourceFile file, string? name, SourceComment? comment, void* data) { + public Namespace (Api.Node parent, SourceFile file, string? name, SourceComment? comment, Vala.Namespace data) { base (parent, file, name, SymbolAccessibility.PUBLIC, data); this.source_comment = comment; diff --git a/libvaladoc/api/node.vala b/libvaladoc/api/node.vala index f1bbd2c62..dfd4a94f3 100644 --- a/libvaladoc/api/node.vala +++ b/libvaladoc/api/node.vala @@ -50,7 +50,7 @@ public abstract class Valadoc.Api.Node : Item, Browsable, Documentation { private Vala.Map> per_type_children; - public Node (Node? parent, SourceFile? file, string? name, void* data) { + public Node (Node? parent, SourceFile? file, string? name, Vala.CodeNode? data) { base (data); per_name_children = new Vala.HashMap (str_hash, str_equal); diff --git a/libvaladoc/api/package.vala b/libvaladoc/api/package.vala index 821230ecf..8942d9e1c 100644 --- a/libvaladoc/api/package.vala +++ b/libvaladoc/api/package.vala @@ -73,7 +73,7 @@ public class Valadoc.Api.Package : Node { return this._dependencies; } - public Package (string name, bool is_package, void* data) { + public Package (string name, bool is_package, Vala.CodeNode? data) { base (null, null, name, data); this.is_package = is_package; diff --git a/libvaladoc/api/pointer.vala b/libvaladoc/api/pointer.vala index 954acd949..14bb6e0e8 100644 --- a/libvaladoc/api/pointer.vala +++ b/libvaladoc/api/pointer.vala @@ -36,7 +36,7 @@ public class Valadoc.Api.Pointer : Item { get; } - public Pointer (Item parent, void* data) { + public Pointer (Item parent, Vala.PointerType data) { base (data); this.parent = parent; diff --git a/libvaladoc/api/property.vala b/libvaladoc/api/property.vala index d981c9027..c50b2b271 100644 --- a/libvaladoc/api/property.vala +++ b/libvaladoc/api/property.vala @@ -33,7 +33,7 @@ public class Valadoc.Api.Property : Member { public Property (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? dbus_name, bool is_dbus_visible, - PropertyBindingType binding_type, void* data) + PropertyBindingType binding_type, Vala.Property data) { base (parent, file, name, accessibility, comment, data); diff --git a/libvaladoc/api/propertyaccessor.vala b/libvaladoc/api/propertyaccessor.vala index 173edd89d..89de374bb 100644 --- a/libvaladoc/api/propertyaccessor.vala +++ b/libvaladoc/api/propertyaccessor.vala @@ -32,7 +32,7 @@ public class Valadoc.Api.PropertyAccessor : Symbol { private string? cname; public PropertyAccessor (Property parent, SourceFile file, string name, SymbolAccessibility accessibility, - string? cname, PropertyAccessorType type, Ownership ownership, void* data) + string? cname, PropertyAccessorType type, Ownership ownership, Vala.PropertyAccessor data) { base (parent, file, name, accessibility, data); diff --git a/libvaladoc/api/signal.vala b/libvaladoc/api/signal.vala index 6e6f8855f..7da544bbd 100644 --- a/libvaladoc/api/signal.vala +++ b/libvaladoc/api/signal.vala @@ -43,7 +43,7 @@ public class Valadoc.Api.Signal : Member, Callable { public Signal (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? default_impl_cname, string? dbus_name, bool is_dbus_visible, - bool is_virtual, void* data) + bool is_virtual, Vala.Signal data) { base (parent, file, name, accessibility, comment, data); diff --git a/libvaladoc/api/sourcefile.vala b/libvaladoc/api/sourcefile.vala index 9c3401145..262c5b188 100644 --- a/libvaladoc/api/sourcefile.vala +++ b/libvaladoc/api/sourcefile.vala @@ -45,12 +45,12 @@ public class Valadoc.Api.SourceFile : Object { return Path.get_basename (relative_path); } - public void* data { + public Vala.SourceFile? data { private set; get; } - public SourceFile (Package package, string relative_path, string? relative_c_path, void* data) { + public SourceFile (Package package, string relative_path, string? relative_c_path, Vala.SourceFile? data) { this.relative_c_path = relative_c_path; this.relative_path = relative_path; this.package = package; diff --git a/libvaladoc/api/struct.vala b/libvaladoc/api/struct.vala index 93bbce778..d35d5ff93 100644 --- a/libvaladoc/api/struct.vala +++ b/libvaladoc/api/struct.vala @@ -38,7 +38,7 @@ public class Valadoc.Api.Struct : TypeSymbol { SourceComment? comment, string? cname, string? type_macro_name, string? type_function_name, string? type_id, string? dup_function_cname, string? copy_function_cname, string? destroy_function_cname, - string? free_function_cname, bool is_basic_type, void* data) + string? free_function_cname, bool is_basic_type, Vala.Struct data) { base (parent, file, name, accessibility, comment, type_macro_name, null, null, type_function_name, is_basic_type, data); diff --git a/libvaladoc/api/symbol.vala b/libvaladoc/api/symbol.vala index 020c28ab1..3b375a330 100644 --- a/libvaladoc/api/symbol.vala +++ b/libvaladoc/api/symbol.vala @@ -35,7 +35,7 @@ public abstract class Valadoc.Api.Symbol : Node { } public Symbol (Node parent, SourceFile file, string? name, SymbolAccessibility accessibility, - void* data) + Vala.Symbol data) { base (parent, file, name, data); diff --git a/libvaladoc/api/tree.vala b/libvaladoc/api/tree.vala index 833aea529..e357fe08e 100644 --- a/libvaladoc/api/tree.vala +++ b/libvaladoc/api/tree.vala @@ -53,7 +53,7 @@ public class Valadoc.Api.Tree { this.packages.add (package); } - public void* data { + public Vala.CodeContext context { set; get; } @@ -216,10 +216,10 @@ public class Valadoc.Api.Tree { return params; } - public Tree (ErrorReporter reporter, Settings settings, void* data = null) { + public Tree (ErrorReporter reporter, Settings settings, Vala.CodeContext context) { this.settings = settings; this.reporter = reporter; - this.data = data; + this.context = context; } // copied from valacodecontext.vala diff --git a/libvaladoc/api/typeparameter.vala b/libvaladoc/api/typeparameter.vala index e28215804..bbeaa67c6 100644 --- a/libvaladoc/api/typeparameter.vala +++ b/libvaladoc/api/typeparameter.vala @@ -28,7 +28,7 @@ using Valadoc.Content; */ public class Valadoc.Api.TypeParameter : Symbol { - public TypeParameter (Node parent, SourceFile file, string name, void* data) { + public TypeParameter (Node parent, SourceFile file, string name, Vala.TypeParameter data) { base (parent, file, name, SymbolAccessibility.PUBLIC, data); } diff --git a/libvaladoc/api/typereference.vala b/libvaladoc/api/typereference.vala index 5f29f293f..884b721bc 100644 --- a/libvaladoc/api/typereference.vala +++ b/libvaladoc/api/typereference.vala @@ -32,7 +32,7 @@ public class Valadoc.Api.TypeReference : Item { private Ownership ownership; public TypeReference (Item parent, Ownership ownership, bool pass_ownership, bool is_dynamic, - bool is_nullable, string? dbus_type_signature, void* data) + bool is_nullable, string? dbus_type_signature, Vala.DataType? data) { base (data); diff --git a/libvaladoc/api/typesymbol.vala b/libvaladoc/api/typesymbol.vala index c7274ba01..17c3501c8 100644 --- a/libvaladoc/api/typesymbol.vala +++ b/libvaladoc/api/typesymbol.vala @@ -35,7 +35,7 @@ public abstract class Valadoc.Api.TypeSymbol : Symbol { public TypeSymbol (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? type_macro_name, string? is_type_macro_name, string? type_cast_macro_name, string? type_function_name, bool is_basic_type, - void* data) + Vala.TypeSymbol data) { base (parent, file, name, accessibility, data); diff --git a/valadoc/driver.vala b/valadoc/driver.vala index 60d00e599..9bd4a3e19 100644 --- a/valadoc/driver.vala +++ b/valadoc/driver.vala @@ -39,7 +39,7 @@ public class Valadoc.Drivers.Driver : Object, Valadoc.Driver { gir_directory = settings.gir_directory; } - gir_writer.write_file ((Vala.CodeContext) tree.data, + gir_writer.write_file (tree.context, gir_directory, "%s-%s.gir".printf (settings.gir_namespace, settings.gir_version), settings.gir_namespace, diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala index b2fdd6f10..0b81481c0 100644 --- a/valadoc/treebuilder.vala +++ b/valadoc/treebuilder.vala @@ -862,12 +862,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor { } } - private Vala.CodeContext create_valac_tree (Settings settings) { - // init context: - var context = new Vala.CodeContext (); - Vala.CodeContext.push (context); - - + private void create_valac_tree (Vala.CodeContext context, Settings settings) { // settings: context.experimental = settings.experimental; context.experimental_non_null = settings.experimental || settings.experimental_non_null; @@ -943,21 +938,20 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor { // add user defined files: add_depencies (context, settings.packages); if (reporter.errors > 0) { - return context; + return; } add_documented_files (context, settings.source_files); if (reporter.errors > 0) { - return context; + return; } - // parse vala-code: Vala.Parser parser = new Vala.Parser (); parser.parse (context); if (context.report.get_errors () > 0) { - return context; + return; } // parse gir: @@ -965,18 +959,14 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor { gir_parser.parse (context); if (context.report.get_errors () > 0) { - return context; + return; } - - // check context: context.check (); if (context.report.get_errors () > 0) { - return context; + return; } - - return context; } @@ -1503,17 +1493,15 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor { this.settings = settings; this.reporter = reporter; - this.tree = new Api.Tree (reporter, settings); - var context = create_valac_tree (settings); - this.tree.data = context; + var context = new Vala.CodeContext (); + Vala.CodeContext.push (context); + + this.tree = new Api.Tree (reporter, settings, context); + create_valac_tree (context, settings); reporter.warnings_offset = context.report.get_warnings (); reporter.errors_offset = context.report.get_errors (); - if (context == null) { - return null; - } - // TODO: Register all packages here // register packages included by gir-files foreach (Vala.SourceFile vfile in context.get_source_files ()) { -- cgit v1.2.1