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, 14 insertions, 0 deletions
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 <character> TOK_CHAR
%type <node> 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); }
;
%%