THRIFT-413. Suppport for annotations on base types
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@798219 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy
index bf5408e..026e5c3 100644
--- a/compiler/cpp/src/thrifty.yy
+++ b/compiler/cpp/src/thrifty.yy
@@ -154,6 +154,7 @@
*/
%type<ttype> BaseType
+%type<ttype> SimpleBaseType
%type<ttype> ContainerType
%type<ttype> SimpleContainerType
%type<ttype> MapType
@@ -976,7 +977,19 @@
$$ = $1;
}
-BaseType:
+BaseType: SimpleBaseType TypeAnnotations
+ {
+ pdebug("BaseType -> SimpleBaseType TypeAnnotations");
+ if ($2 != NULL) {
+ $$ = new t_base_type(*static_cast<t_base_type*>($1));
+ $$->annotations_ = $2->annotations_;
+ delete $2;
+ } else {
+ $$ = $1;
+ }
+ }
+
+SimpleBaseType:
tok_string
{
pdebug("BaseType -> tok_string");