summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2022-09-14 00:29:07 +0200
committerJens Geyer <Jens-G@users.noreply.github.com>2022-09-14 08:48:34 +0200
commit9b09a1160a26472c98de70c5c3dcdd77347fe227 (patch)
treecae72014b2a8ae43ccd94daf29c368dfff9a63ff /compiler
parent97323f3debf6fa47b27fba348b04271c9117c81a (diff)
downloadthrift-9b09a1160a26472c98de70c5c3dcdd77347fe227.tar.gz
THRIFT-5627 More consistent syntax for cpp_type
Patch: Jens Geyer
Diffstat (limited to 'compiler')
-rw-r--r--compiler/cpp/src/thrift/thrifty.yy17
1 files changed, 12 insertions, 5 deletions
diff --git a/compiler/cpp/src/thrift/thrifty.yy b/compiler/cpp/src/thrift/thrifty.yy
index bb2c19e44..2d67c1a78 100644
--- a/compiler/cpp/src/thrift/thrifty.yy
+++ b/compiler/cpp/src/thrift/thrifty.yy
@@ -1265,13 +1265,20 @@ SetType:
}
ListType:
- tok_list '<' FieldType '>' CppType
+ tok_list CppType '<' FieldType '>' CppType // the second CppType is for compatibility reasons = deprecated
{
pdebug("ListType -> tok_list<FieldType>");
- check_for_list_of_bytes($3);
- $$ = new t_list($3);
- if ($5 != nullptr) {
- ((t_container*)$$)->set_cpp_name(std::string($5));
+ check_for_list_of_bytes($4);
+ $$ = new t_list($4);
+ if ($2 != nullptr) {
+ ((t_container*)$$)->set_cpp_name(std::string($2));
+ }
+ if ($6 != nullptr) {
+ ((t_container*)$$)->set_cpp_name(std::string($6));
+ pwarning(1, "The syntax 'list<type> cpp_type \"c++ type\"' is deprecated. Use 'list cpp_type \"c++ type\" <type>' instead.\n");
+ }
+ if (($2 != nullptr) && ($6 != nullptr)) {
+ pwarning(1, "Two cpp_types clauses at list<%>\n", $2);
}
}