[gedit-code-assistance] Added utility to find children of a particular semantic value



commit 46f8858d4217761e7a75137b11e92c9acbce565e
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Sun Nov 13 19:10:26 2011 +0100

    Added utility to find children of a particular semantic value

 src/gcp-semantic-value.vala |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/gcp-semantic-value.vala b/src/gcp-semantic-value.vala
index a7c2b1d..63e9cfc 100644
--- a/src/gcp-semantic-value.vala
+++ b/src/gcp-semantic-value.vala
@@ -63,6 +63,23 @@ abstract class SemanticValue : Object, SourceRangeSupport
 		get { return d_rtype; }
 	}
 
+	public SemanticValue? find_child(Kind kind)
+	{
+		SemanticValue? child = down;
+
+		while (child != null)
+		{
+			if (child.kind == kind)
+			{
+				return child;
+			}
+
+			child = child.next;
+		}
+
+		return child;
+	}
+
 	public abstract SemanticValue? definition
 	{
 		owned get;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]