vala r1353 - in trunk: . vala



Author: juergbi
Date: Sat May 10 14:55:38 2008
New Revision: 1353
URL: http://svn.gnome.org/viewvc/vala?rev=1353&view=rev

Log:
2008-05-10  Juerg Billeter  <j bitron ch>

	* vala/valaattributeprocessor.vala:
	* vala/valaenumvalue.vala:

	Support cname attribute for enum values,
	patch by Jared Moore, fixes bug 529288


Modified:
   trunk/ChangeLog
   trunk/vala/valaattributeprocessor.vala
   trunk/vala/valaenumvalue.vala

Modified: trunk/vala/valaattributeprocessor.vala
==============================================================================
--- trunk/vala/valaattributeprocessor.vala	(original)
+++ trunk/vala/valaattributeprocessor.vala	Sat May 10 14:55:38 2008
@@ -68,6 +68,12 @@
 
 	public override void visit_enum (Enum en) {
 		en.process_attributes ();
+
+		en.accept_children (this);
+	}
+
+	public override void visit_enum_value (EnumValue ev) {
+		ev.process_attributes ();
 	}
 
 	public override void visit_error_domain (ErrorDomain edomain) {

Modified: trunk/vala/valaenumvalue.vala
==============================================================================
--- trunk/vala/valaenumvalue.vala	(original)
+++ trunk/vala/valaenumvalue.vala	Sat May 10 14:55:38 2008
@@ -95,6 +95,18 @@
 	}
 
 	/**
+	 * Process all associated attributes.
+	 */
+	public void process_attributes () {
+		foreach (Attribute a in attributes) {
+			if (a.name == "CCode" && a.has_argument("cname")) {
+				cname = a.get_string ("cname");
+			}
+		}
+	}
+
+
+	/**
 	 * Returns the name of this enum value as it is used in C code.
 	 *
 	 * @return the name to be used in C code



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