[vala] Add get_type functions to symbols file



commit dc9e9e3bfbce240175e52c606b0a21f7356369dc
Author: Jürg Billeter <j bitron ch>
Date:   Sat Jan 15 13:07:39 2011 +0100

    Add get_type functions to symbols file
    
    Fixes bug 637909.

 ccode/valaccodefile.vala |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/ccode/valaccodefile.vala b/ccode/valaccodefile.vala
index 88bba4a..128cd39 100644
--- a/ccode/valaccodefile.vala
+++ b/ccode/valaccodefile.vala
@@ -1,6 +1,6 @@
 /* valaccodefile.vala
  *
- * Copyright (C) 2009-2010  Jürg Billeter
+ * Copyright (C) 2009-2011  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -85,13 +85,21 @@ public class Vala.CCodeFile {
 
 	public List<string> get_symbols () {
 		var symbols = new ArrayList<string> ();
-		foreach (CCodeNode node in type_member_declaration.get_children ()) {
-			var func = node as CCodeFunction;
-			if (func != null) {
-				symbols.add (func.name);
+		get_symbols_from_fragment (symbols, type_member_declaration);
+		return symbols;
+	}
+
+	void get_symbols_from_fragment (List<string> symbols, CCodeFragment fragment) {
+		foreach (CCodeNode node in fragment.get_children ()) {
+			if (node is CCodeFragment) {
+				get_symbols_from_fragment (symbols, (CCodeFragment) node);
+			} else {
+				var func = node as CCodeFunction;
+				if (func != null) {
+					symbols.add (func.name);
+				}
 			}
 		}
-		return symbols;
 	}
 
 	static string get_define_for_filename (string filename) {



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