vala r2004 - in trunk: . vala
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2004 - in trunk: . vala
- Date: Sun, 9 Nov 2008 18:44:16 +0000 (UTC)
Author: juergbi
Date: Sun Nov 9 18:44:16 2008
New Revision: 2004
URL: http://svn.gnome.org/viewvc/vala?rev=2004&view=rev
Log:
2008-11-09 JÃrg Billeter <j bitron ch>
* vala/valaclass.vala:
* vala/valainterface.vala:
* vala/valamemberaccess.vala:
* vala/valaobjecttype.vala:
* vala/valasemanticanalyzer.vala:
Ensure attributes of base types are processed before querying
C header filenames
Modified:
trunk/ChangeLog
trunk/vala/valaclass.vala
trunk/vala/valainterface.vala
trunk/vala/valamemberaccess.vala
trunk/vala/valaobjecttype.vala
trunk/vala/valasemanticanalyzer.vala
Modified: trunk/vala/valaclass.vala
==============================================================================
--- trunk/vala/valaclass.vala (original)
+++ trunk/vala/valaclass.vala Sun Nov 9 18:44:16 2008
@@ -858,10 +858,22 @@
process_attributes ();
+ var old_source_file = analyzer.current_source_file;
+ var old_symbol = analyzer.current_symbol;
+ var old_class = analyzer.current_class;
+
+ if (source_reference != null) {
+ analyzer.current_source_file = source_reference.file;
+ }
analyzer.current_symbol = this;
analyzer.current_class = this;
foreach (DataType base_type_reference in get_base_types ()) {
+ if (!base_type_reference.check (analyzer)) {
+ error = true;
+ return false;
+ }
+
// check whether base type is at least as accessible as the class
if (!analyzer.is_type_accessible (this, base_type_reference)) {
error = true;
@@ -993,8 +1005,9 @@
}
}
- analyzer.current_symbol = analyzer.current_symbol.parent_symbol;
- analyzer.current_class = null;
+ analyzer.current_source_file = old_source_file;
+ analyzer.current_symbol = old_symbol;
+ analyzer.current_class = old_class;
return !error;
}
Modified: trunk/vala/valainterface.vala
==============================================================================
--- trunk/vala/valainterface.vala (original)
+++ trunk/vala/valainterface.vala Sun Nov 9 18:44:16 2008
@@ -550,6 +550,12 @@
process_attributes ();
+ var old_source_file = analyzer.current_source_file;
+ var old_symbol = analyzer.current_symbol;
+
+ if (source_reference != null) {
+ analyzer.current_source_file = source_reference.file;
+ }
analyzer.current_symbol = this;
foreach (DataType prerequisite_reference in get_prerequisites ()) {
@@ -586,7 +592,8 @@
accept_children (analyzer);
- analyzer.current_symbol = analyzer.current_symbol.parent_symbol;
+ analyzer.current_source_file = old_source_file;
+ analyzer.current_symbol = old_symbol;
return !error;
}
Modified: trunk/vala/valamemberaccess.vala
==============================================================================
--- trunk/vala/valamemberaccess.vala (original)
+++ trunk/vala/valamemberaccess.vala Sun Nov 9 18:44:16 2008
@@ -233,7 +233,7 @@
}
if (symbol_reference == null) {
- foreach (UsingDirective ns in analyzer.current_using_directives) {
+ foreach (UsingDirective ns in analyzer.current_source_file.get_using_directives ()) {
var local_sym = ns.namespace_symbol.scope.lookup (member_name);
if (local_sym != null) {
if (symbol_reference != null) {
Modified: trunk/vala/valaobjecttype.vala
==============================================================================
--- trunk/vala/valaobjecttype.vala (original)
+++ trunk/vala/valaobjecttype.vala Sun Nov 9 18:44:16 2008
@@ -98,4 +98,8 @@
return null;
}
}
+
+ public override bool check (SemanticAnalyzer analyzer) {
+ return type_symbol.check (analyzer);
+ }
}
Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala (original)
+++ trunk/vala/valasemanticanalyzer.vala Sun Nov 9 18:44:16 2008
@@ -37,8 +37,6 @@
public Class current_class;
public Struct current_struct;
- public Gee.List<UsingDirective> current_using_directives;
-
public DataType bool_type;
public DataType string_type;
public DataType uchar_type;
@@ -129,13 +127,10 @@
public override void visit_source_file (SourceFile file) {
current_source_file = file;
- current_using_directives = file.get_using_directives ();
next_lambda_id = 0;
file.accept_children (this);
-
- current_using_directives = null;
}
public override void visit_namespace (Namespace ns) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]