From: Juerg Billeter Date: Sun, 13 Apr 2008 19:37:49 +0000 (+0000) Subject: support generic structs X-Git-Tag: VALA_0_3_1~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f37c2a99e05c421cfc273716ab5891a2ce0c99b;p=platform%2Fupstream%2Fvala.git support generic structs 2008-04-13 Juerg Billeter * vala/valaparser.vala: support generic structs svn path=/trunk/; revision=1215 --- diff --git a/ChangeLog b/ChangeLog index 9f1e73e..ac47697 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-04-13 Jürg Billeter + * vala/valaparser.vala: support generic structs + +2008-04-13 Jürg Billeter + * compiler/valacompiler.vala: fix typo 2008-04-13 Jürg Billeter diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 4f688e8..0f67b22 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -2167,6 +2167,7 @@ public class Vala.Parser : CodeVisitor { parse_type_declaration_modifiers (); expect (TokenType.STRUCT); var sym = parse_symbol_name (); + var type_param_list = parse_type_parameter_list (); var base_types = new ArrayList (); if (accept (TokenType.COLON)) { do { @@ -2176,6 +2177,9 @@ public class Vala.Parser : CodeVisitor { var st = context.create_struct (sym.name, get_src_com (begin)); st.access = access; set_attributes (st, attrs); + foreach (TypeParameter type_param in type_param_list) { + st.add_type_parameter (type_param); + } foreach (DataType base_type in base_types) { st.add_base_type (base_type); }