From 9b09a1160a26472c98de70c5c3dcdd77347fe227 Mon Sep 17 00:00:00 2001 From: Jens Geyer Date: Wed, 14 Sep 2022 00:29:07 +0200 Subject: THRIFT-5627 More consistent syntax for cpp_type Patch: Jens Geyer --- compiler/cpp/src/thrift/thrifty.yy | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'compiler') 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"); - 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 cpp_type \"c++ type\"' is deprecated. Use 'list cpp_type \"c++ type\" ' instead.\n"); + } + if (($2 != nullptr) && ($6 != nullptr)) { + pwarning(1, "Two cpp_types clauses at list<%>\n", $2); } } -- cgit v1.2.1