]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gidl parse default_value for enums
authorMarc-André Lureau <marcandre.lureau@gmail.com>
Fri, 28 Oct 2011 23:17:16 +0000 (01:17 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 31 Jan 2012 12:13:02 +0000 (13:13 +0100)
It can be useful for correct default value in properties

https://bugzilla.gnome.org/show_bug.cgi?id=662974

vapigen/valagidlparser.vala

index 66141dd6894fe080d710af19e0159506bd4a7be0..f93784df09b7a0543d433e4b05ff3dc8f9fbda99 100644 (file)
@@ -1391,6 +1391,8 @@ public class Vala.GIdlParser : CodeVisitor {
                                        if (eval (nv[1]) == "1") {
                                                en.set_attribute ("Deprecated", true);
                                        }
+                               } else if (nv[0] == "default_value") {
+                                       en.set_attribute_string ("CCode", "default_value", eval (nv[1]));
                                } else if (nv[0] == "replacement") {
                                        en.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
                                } else if (nv[0] == "deprecated_since") {