hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/sfinae.y
diff options
context:
space:
mode:
Diffstat (limited to 'sfinae.y')
-rw-r--r--sfinae.y14
1 files changed, 13 insertions, 1 deletions
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 <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