From 1d94e6bab25ecb1e36f9c1e4c10177bdb1314aa3 Mon Sep 17 00:00:00 2001 From: Raffaele Sandrini Date: Thu, 24 Jan 2008 14:16:19 +0000 Subject: [PATCH] allow constant declarations in structs 2008-01-24 Raffaele Sandrini * vala/parser.y: allow constant declarations in structs svn path=/trunk/; revision=905 --- ChangeLog | 4 ++++ vala/parser.y | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 28cc621..43bd4ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-01-24 Raffaele Sandrini + * vala/parser.y: allow constant declarations in structs + +2008-01-24 Raffaele Sandrini + * vala/parser.y: report initializers in struct fields as error 2008-01-24 Jürg Billeter diff --git a/vala/parser.y b/vala/parser.y index efc31d6..704681d 100644 --- a/vala/parser.y +++ b/vala/parser.y @@ -3590,7 +3590,15 @@ struct_member_declarations ; struct_member_declaration - : field_declaration + : constant_declaration + { + /* skip declarations with errors */ + if ($1 != NULL) { + vala_struct_add_constant (VALA_STRUCT (symbol_stack->data), $1); + g_object_unref ($1); + } + } + | field_declaration { /* skip declarations with errors */ if ($1 != NULL) { -- 2.7.4