hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/sfinae.y
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-19 16:15:50 +0200
committerhachem <im@hachem.wtf>2026-09-19 16:15:50 +0200
commit0a9605b6b13f2e066a69662f5802b397f8b89424 (patch)
treefe063a37fb8de67f3e176ec99cc4a1cc1cadf21d /sfinae.y
parentbe43ea893018090044cd411bc5b50787b99087b8 (diff)
feat: char and integral_constant types
Diffstat (limited to 'sfinae.y')
-rw-r--r--sfinae.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/sfinae.y b/sfinae.y
index 341be36..aa7650b 100644
--- a/sfinae.y
+++ b/sfinae.y
@@ -32,6 +32,7 @@ void yyerror(const char* message);
%token TOK_INT32
%token TOK_BYTE
%token TOK_SIZE_T
+%token TOK_CHAR_T
%token TOK_REMOVE_CV
%token TOK_DECLTYPE
%token TOK_DIFFERENCE
@@ -138,6 +139,10 @@ type
{ $$ = node_ternary(TYPE_CONDITIONAL, $4, $6, $8); }
| TOK_COLONCOLON TOK_DECLTYPE '(' value ')'
{ $$ = node_unary(TYPE_DECLTYPE, $4); }
+ | TOK_COLONCOLON TOK_CHAR_T
+ { $$ = node_leaf(TYPE_CHAR); }
+ | TOK_COLONCOLON TOK_INTEGRAL_CONSTANT '<' TOK_COLONCOLON TOK_CHAR_T ',' value '>'
+ { $$ = node_unary(TYPE_CHAR_CONSTANT, $7); }
;
value