diff options
author | Jürg Billeter <j@bitron.ch> | 2011-01-15 13:07:39 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2011-01-15 13:07:39 +0100 |
commit | dc9e9e3bfbce240175e52c606b0a21f7356369dc (patch) | |
tree | e16b03ffec34b070b960a0e48fe7f6af8b3c91b7 | |
parent | 65966a1616a134e3367150f8d9fc4d2f43ff4442 (diff) | |
download | vala-dc9e9e3bfbce240175e52c606b0a21f7356369dc.tar.gz |
Add get_type functions to symbols file
Fixes bug 637909.
-rw-r--r-- | ccode/valaccodefile.vala | 20 |
1 files changed, 14 insertions, 6 deletions
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<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) { |