From a79c97e04562b171780a24cba2cb1a71acfa4bbb Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 19 Sep 2026 12:38:43 +0200 Subject: types: array, extent, tuple_size, integral_constant --- sfinae.y | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sfinae.y') diff --git a/sfinae.y b/sfinae.y index 5a590a2..5b5d1be 100644 --- a/sfinae.y +++ b/sfinae.y @@ -28,6 +28,11 @@ void yyerror(const char* message); %token TOK_SUM %token TOK_PRODUCT %token TOK_QUOTIENT +%token TOK_ARRAY +%token TOK_EXTENT +%token TOK_TUPLE_SIZE +%token TOK_INTEGRAL_CONSTANT +%token TOK_VALUE %token TOK_CHAR %type statements statement type value @@ -62,6 +67,8 @@ type { $$ = node_leaf(TYPE_SIZE); } | TOK_COLONCOLON TOK_REMOVE_CV '<' type '>' { $$ = node_unary(TYPE_REMOVE_CV, $4); } + | TOK_COLONCOLON TOK_ARRAY '<' type ',' value '>' + { $$ = node_binary(TYPE_ARRAY, $4, $6); } | TOK_COLONCOLON TOK_DECLTYPE '(' value ')' { $$ = node_unary(TYPE_DECLTYPE, $4); } ; @@ -75,6 +82,13 @@ value { $$ = node_binary(VALUE_PRODUCT, $4, $6); } | TOK_COLONCOLON TOK_QUOTIENT '<' value ',' value '>' { $$ = node_binary(VALUE_QUOTIENT, $4, $6); } + | TOK_COLONCOLON TOK_EXTENT '<' type '>' TOK_COLONCOLON TOK_VALUE + { $$ = node_unary(VALUE_EXTENT, $4); } + | TOK_COLONCOLON TOK_TUPLE_SIZE '<' type '>' TOK_COLONCOLON TOK_VALUE + { $$ = node_unary(VALUE_TUPLE_SIZE, $4); } + | TOK_COLONCOLON TOK_INTEGRAL_CONSTANT '<' TOK_COLONCOLON TOK_SIZE_T ',' value '>' + TOK_COLONCOLON TOK_VALUE + { $$ = node_unary(VALUE_INTEGRAL_CONSTANT, $7); } ; %% -- cgit v1.3