var stream = FileStream.open (context.symbols_filename, "w");
if (stream == null) {
Report.error (null, "unable to open `%s' for writing".printf (context.symbols_filename));
+ this.context = null;
return;
}
Report.error (null, "unable to open `%s' for writing".printf (context.internal_header_filename));
}
}
+
+ this.context = null;
}
public void push_context (EmitContext emit_context) {
stream = FileStream.open (filename, "w");
if (stream == null) {
Report.error (null, "unable to open `%s' for writing".printf (filename));
+ this.context = null;
return;
}
if (our_namespaces.size == 0) {
Report.error (null, "No suitable namespace found to export for GIR");
}
+
+ this.context = null;
}
private void write_doc (string? comment) {
file.accept (this);
}
}
+
+ this.context = null;
}
public override void visit_source_file (SourceFile source_file) {
public void parse (CodeContext context) {
this.context = context;
context.accept (this);
+ this.context = null;
}
public override void visit_source_file (SourceFile source_file) {
foreach (var metadata in metadata_roots) {
report_unused_metadata (metadata);
}
+
+ this.context = null;
}
void map_vala_to_gir () {
public void parse (CodeContext context) {
this.context = context;
context.accept (this);
+ this.context = null;
}
public override void visit_source_file (SourceFile source_file) {
* Code visitor analyzing and checking code.
*/
public class Vala.SemanticAnalyzer : CodeVisitor {
- public CodeContext context { get; set; }
+ CodeContext context;
- public Symbol root_symbol;
public Symbol current_symbol { get; set; }
public SourceFile current_source_file { get; set; }
public void analyze (CodeContext context) {
this.context = context;
- root_symbol = context.root;
+ var root_symbol = context.root;
bool_type = new BooleanType ((Struct) root_symbol.scope.lookup ("bool"));
string_type = new ObjectType ((Class) root_symbol.scope.lookup ("string"));
current_symbol = root_symbol;
context.root.check (context);
context.accept (this);
+
+ this.context = null;
}
public override void visit_source_file (SourceFile file) {
root_symbol = context.root;
context.root.accept (this);
+
+ root_symbol = null;
+ this.context = null;
}
public override void visit_namespace (Namespace ns) {