diff options
| author | hachem <im@hachem.wtf> | 2026-09-19 16:20:14 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-19 16:20:14 +0200 |
| commit | cd2a86435e5e413630e0ab0caa48d900e49ea275 (patch) | |
| tree | 559a1bfc52a853b61fe07e0b7aa17eca977f5fd2 /sfinae.y | |
| parent | 0a9605b6b13f2e066a69662f5802b397f8b89424 (diff) | |
feat: tuples baby
Diffstat (limited to 'sfinae.y')
| -rw-r--r-- | sfinae.y | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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 <character> TOK_CHAR %type <name> name char_list -%type <node> statements statement sequence sequence_items type value condition +%type <node> 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 |
