From 32c86d9f1432f479e0cfb4fb52d433a9343d190e Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 29 Dec 2022 21:52:30 +0000 Subject: [PATCH] Slight simplification parsing variadic template parameters --- Source/CParse/parser.y | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 4035119a1..734e53a34 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -6969,23 +6969,15 @@ access_specifier : PUBLIC { $$ = (char*)"public"; } | PROTECTED { $$ = (char*)"protected"; } ; -templcpptype : CLASS { +templcpptype : CLASS variadic_opt { $$ = NewString("class"); if (!inherit_list) last_cpptype = $$; + if ($2) SwigType_add_variadic($$); } - | TYPENAME { + | TYPENAME variadic_opt { $$ = NewString("typename"); if (!inherit_list) last_cpptype = $$; - } - | CLASS ELLIPSIS { - $$ = NewString("class"); - $$ = SwigType_add_variadic($$); - if (!inherit_list) last_cpptype = $$; - } - | TYPENAME ELLIPSIS { - $$ = NewString("typename"); - $$ = SwigType_add_variadic($$); - if (!inherit_list) last_cpptype = $$; + if ($2) SwigType_add_variadic($$); } ;