Author: dreiss
Date: Mon Jul 27 17:02:42 2009
New Revision: 798219
URL: http://svn.apache.org/viewvc?rev=798219&view=rev
Log:
THRIFT-413. Suppport for annotations on base types
Modified:
incubator/thrift/trunk/compiler/cpp/src/thrifty.yy
incubator/thrift/trunk/test/AnnotationTest.thrift
Modified: incubator/thrift/trunk/compiler/cpp/src/thrifty.yy
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/thrifty.yy?rev=798219&r1=798218&r2=798219&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/thrifty.yy (original)
+++ incubator/thrift/trunk/compiler/cpp/src/thrifty.yy Mon Jul 27 17:02:42 2009
@@ -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");
Modified: incubator/thrift/trunk/test/AnnotationTest.thrift
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/test/AnnotationTest.thrift?rev=798219&r1=798218&r2=798219&view=diff
==============================================================================
--- incubator/thrift/trunk/test/AnnotationTest.thrift (original)
+++ incubator/thrift/trunk/test/AnnotationTest.thrift Mon Jul 27 17:02:42 2009
@@ -29,3 +29,6 @@
python.type = "DenseFoo",
java.final = "",
)
+
+typedef string ( unicode.encoding = "UTF-16" ) non_latin_string
+typedef list< double ( cpp.fixed_point = "16" ) > tiny_float_list