From dc9e9e3bfbce240175e52c606b0a21f7356369dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Sat, 15 Jan 2011 13:07:39 +0100 Subject: Add get_type functions to symbols file Fixes bug 637909. --- ccode/valaccodefile.vala | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'ccode') diff --git a/ccode/valaccodefile.vala b/ccode/valaccodefile.vala index 88bba4a0d..128cd3938 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 get_symbols () { var symbols = new ArrayList (); - 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 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) { -- cgit v1.2.1