summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2022-12-29 21:52:30 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2022-12-30 00:20:37 +0000
commit32c86d9f1432f479e0cfb4fb52d433a9343d190e (patch)
tree67d2f67ae81a619a569e2f98cb48d9071c50a1c0
parent004af63f3cef63fbe91389cec1ad0c84498915e2 (diff)
downloadswig-32c86d9f1432f479e0cfb4fb52d433a9343d190e.tar.gz
Slight simplification parsing variadic template parameters
-rw-r--r--Source/CParse/parser.y16
1 files 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($$);
}
;