From cd2a86435e5e413630e0ab0caa48d900e49ea275 Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 19 Sep 2026 16:20:14 +0200 Subject: feat: tuples baby --- sfinae.y | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'sfinae.y') diff --git a/sfinae.y b/sfinae.y index aa7650b..9fe994c 100644 --- a/sfinae.y +++ b/sfinae.y @@ -33,6 +33,7 @@ void yyerror(const char* message); %token TOK_BYTE %token TOK_SIZE_T %token TOK_CHAR_T +%token TOK_TUPLE %token TOK_REMOVE_CV %token TOK_DECLTYPE %token TOK_DIFFERENCE @@ -54,7 +55,7 @@ void yyerror(const char* message); %token TOK_CHAR %type name char_list -%type statements statement sequence sequence_items type value condition +%type statements statement sequence sequence_items type type_list value condition %% @@ -143,6 +144,17 @@ type { $$ = node_leaf(TYPE_CHAR); } | TOK_COLONCOLON TOK_INTEGRAL_CONSTANT '<' TOK_COLONCOLON TOK_CHAR_T ',' value '>' { $$ = node_unary(TYPE_CHAR_CONSTANT, $7); } + | TOK_COLONCOLON TOK_TUPLE '<' type_list '>' + { $$ = node_unary(TYPE_TUPLE, $4); } + ; + +type_list + : /* nothing */ + { $$ = NULL; } + | type + { $$ = $1; } + | type_list ',' type + { $$ = node_append($1, $3); } ; value -- cgit v1.3