On Fri, Oct 29, 2010 at 8:51 PM, pancake <[email protected]> wrote:
> Nope. It fails. FormalParameter has been renamed
>
Here is a patch that renames references to Vala.FormalParameter to
Vala.Parameter and calls CodeContext.check () instead of manually
instantiating SymbolResolver and the other visitors.
Vlad
diff --git a/src/libvaladoc/api/formalparameter.vala b/src/libvaladoc/api/formalparameter.vala
index e1427d8..1dd7bc8 100644
--- a/src/libvaladoc/api/formalparameter.vala
+++ b/src/libvaladoc/api/formalparameter.vala
@@ -24,26 +24,26 @@ using Gee;
using Valadoc.Content;
public class Valadoc.Api.FormalParameter : Symbol {
- public FormalParameter (Vala.FormalParameter symbol, Node parent) {
+ public FormalParameter (Vala.Parameter symbol, Node parent) {
base (symbol, parent);
parameter_type = new TypeReference (symbol.variable_type, this);
}
public bool is_out {
get {
- return ((Vala.FormalParameter) symbol).direction == Vala.ParameterDirection.OUT;
+ return ((Vala.Parameter) symbol).direction == Vala.ParameterDirection.OUT;
}
}
public bool is_ref {
get {
- return ((Vala.FormalParameter) symbol).direction == Vala.ParameterDirection.REF;
+ return ((Vala.Parameter) symbol).direction == Vala.ParameterDirection.REF;
}
}
public bool has_default_value {
get {
- return ((Vala.FormalParameter) symbol).initializer != null;
+ return ((Vala.Parameter) symbol).initializer != null;
}
}
@@ -51,7 +51,7 @@ public class Valadoc.Api.FormalParameter : Symbol {
public bool ellipsis {
get {
- return ((Vala.FormalParameter) symbol).ellipsis;
+ return ((Vala.Parameter) symbol).ellipsis;
}
}
@@ -88,7 +88,7 @@ public class Valadoc.Api.FormalParameter : Symbol {
if (has_default_value) {
signature.append ("=");
- signature.append (((Vala.FormalParameter) symbol).initializer.to_string ());
+ signature.append (((Vala.Parameter) symbol).initializer.to_string ());
}
}
diff --git a/src/libvaladoc/api/nodebuilder.vala b/src/libvaladoc/api/nodebuilder.vala
index d0c820f..4a67161 100644
--- a/src/libvaladoc/api/nodebuilder.vala
+++ b/src/libvaladoc/api/nodebuilder.vala
@@ -212,7 +212,7 @@ internal class Valadoc.Api.NodeBuilder : Vala.CodeVisitor {
process_children (node, element);
}
- public override void visit_formal_parameter (Vala.FormalParameter element) {
+ public override void visit_formal_parameter (Vala.Parameter element) {
Node parent = get_parent_node_for (element);
Symbol node = new FormalParameter (element, parent);
diff --git a/src/libvaladoc/api/tree.vala b/src/libvaladoc/api/tree.vala
index cb305c4..42835d3 100644
--- a/src/libvaladoc/api/tree.vala
+++ b/src/libvaladoc/api/tree.vala
@@ -349,14 +349,8 @@ public class Valadoc.Api.Tree {
return false;
}
- Vala.SymbolResolver resolver = new Vala.SymbolResolver ();
- resolver.resolve(this.context);
- if (this.context.report.get_errors () > 0) {
- return false;
- }
+ context.check ();
- Vala.SemanticAnalyzer analyzer = new Vala.SemanticAnalyzer ( );
- analyzer.analyze(this.context);
if (this.context.report.get_errors () > 0) {
return false;
}
diff --git a/src/libvaladoc/api/typereference.vala b/src/libvaladoc/api/typereference.vala
index 007ea69..e31b2f3 100644
--- a/src/libvaladoc/api/typereference.vala
+++ b/src/libvaladoc/api/typereference.vala
@@ -55,9 +55,9 @@ public class Valadoc.Api.TypeReference : Item {
if (node == null) {
return false;
}
- if (node is Vala.FormalParameter) {
- return (((Vala.FormalParameter)node).direction == Vala.ParameterDirection.IN &&
- ((Vala.FormalParameter)node).variable_type.value_owned);
+ if (node is Vala.Parameter) {
+ return (((Vala.Parameter)node).direction == Vala.ParameterDirection.IN &&
+ ((Vala.Parameter)node).variable_type.value_owned);
}
if (node is Vala.Property) {
return ((Vala.Property)node).property_type.value_owned;
@@ -72,11 +72,11 @@ public class Valadoc.Api.TypeReference : Item {
Vala.CodeNode parent = this.vtyperef.parent_node;
// parameter:
- if (parent is Vala.FormalParameter) {
- if (((Vala.FormalParameter)parent).direction != Vala.ParameterDirection.IN) {
+ if (parent is Vala.Parameter) {
+ if (((Vala.Parameter)parent).direction != Vala.ParameterDirection.IN) {
return false;
}
- return ((Vala.FormalParameter)parent).variable_type.value_owned;
+ return ((Vala.Parameter)parent).variable_type.value_owned;
}
return false;
}
@@ -118,7 +118,7 @@ public class Valadoc.Api.TypeReference : Item {
get {
Vala.CodeNode parent = this.vtyperef.parent_node;
- if (parent is Vala.FormalParameter) {
+ if (parent is Vala.Parameter) {
return false;
}
_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list