hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/sfinae.y
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-19 12:03:34 +0200
committerhachem <im@hachem.wtf>2026-09-19 12:03:34 +0200
commit74a8a2b10a0513f5346ec47aa9b463e30f2b972e (patch)
treefd126ece2e3e544c00866ba0aef03989c92a7a05 /sfinae.y
parentb20c46c555986a99be70de61d91bc225e53f31d2 (diff)
feat: add void, int32_t, byte, size_t, remove_cv_t
Diffstat (limited to 'sfinae.y')
-rw-r--r--sfinae.y17
1 files changed, 16 insertions, 1 deletions
diff --git a/sfinae.y b/sfinae.y
index 3e7c9b1..5a590a2 100644
--- a/sfinae.y
+++ b/sfinae.y
@@ -18,6 +18,11 @@ void yyerror(const char* message);
%token TOK_COLONCOLON
%token TOK_EMIT
%token TOK_COMMIT
+%token TOK_VOID
+%token TOK_INT32
+%token TOK_BYTE
+%token TOK_SIZE_T
+%token TOK_REMOVE_CV
%token TOK_DECLTYPE
%token TOK_DIFFERENCE
%token TOK_SUM
@@ -47,7 +52,17 @@ statement
;
type
- : TOK_COLONCOLON TOK_DECLTYPE '(' value ')'
+ : TOK_COLONCOLON TOK_VOID
+ { $$ = node_leaf(TYPE_VOID); }
+ | TOK_COLONCOLON TOK_INT32
+ { $$ = node_leaf(TYPE_INT32); }
+ | TOK_COLONCOLON TOK_BYTE
+ { $$ = node_leaf(TYPE_BYTE); }
+ | TOK_COLONCOLON TOK_SIZE_T
+ { $$ = node_leaf(TYPE_SIZE); }
+ | TOK_COLONCOLON TOK_REMOVE_CV '<' type '>'
+ { $$ = node_unary(TYPE_REMOVE_CV, $4); }
+ | TOK_COLONCOLON TOK_DECLTYPE '(' value ')'
{ $$ = node_unary(TYPE_DECLTYPE, $4); }
;