2008-03-31 Juerg Billeter <j@bitron.ch>
* vala/valainterfacewriter.vala: fix output of enums with methods
svn path=/trunk/; revision=1164
+2008-03-31 Jürg Billeter <j@bitron.ch>
+
+ * vala/valainterfacewriter.vala: fix output of enums with methods
+
2008-03-30 Jürg Billeter <j@bitron.ch>
* vala/valasemanticanalyzer.vala: enhance support for pointer
write_indent ();
- var first = true;
+ bool first = true;
string cheaders;
foreach (string cheader in en.get_cheader_filenames ()) {
if (first) {
write_identifier (en.name);
write_begin_block ();
- en.accept_children (this);
+ first = true;
+ foreach (EnumValue ev in en.get_values ()) {
+ if (first) {
+ first = false;
+ } else {
+ write_string (",");
+ write_newline ();
+ }
- write_end_block ();
- write_newline ();
- }
+ write_indent ();
+ write_identifier (ev.name);
+ }
- public override void visit_enum_value (EnumValue! ev) {
- write_indent ();
- write_identifier (ev.name);
- write_string (",");
+ if (!first) {
+ if (en.get_methods ().size > 0) {
+ write_string (";");
+ }
+ write_newline ();
+ }
+
+ foreach (Method m in en.get_methods ()) {
+ m.accept (this);
+ }
+
+ write_end_block ();
write_newline ();
}