hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/sfinae.y
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-19 13:54:59 +0200
committerhachem <im@hachem.wtf>2026-09-19 13:54:59 +0200
commit7160bdb390ef1c9bdcfb0c075b33be39d62860f3 (patch)
treeee22c43995db73ac7fb8fa65cd9becf917f15628 /sfinae.y
parentd0ca03c84bcad3dc42fd173b0baf3a15e9b52f9b (diff)
feat: static_assert
Diffstat (limited to 'sfinae.y')
-rw-r--r--sfinae.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/sfinae.y b/sfinae.y
index ca3121d..0d7f0ee 100644
--- a/sfinae.y
+++ b/sfinae.y
@@ -17,6 +17,7 @@ void yyerror(const char* message);
%token TOK_COLONCOLON
%token TOK_EMIT
+%token TOK_STATIC_ASSERT
%token TOK_COMMIT
%token TOK_VOID
%token TOK_INT32
@@ -61,6 +62,8 @@ statements
statement
: TOK_COLONCOLON TOK_EMIT '<' type '>' TOK_COLONCOLON TOK_COMMIT
{ $$ = node_unary(STMT_EMIT, $4); }
+ | TOK_COLONCOLON TOK_STATIC_ASSERT '<' condition '>' TOK_COLONCOLON TOK_COMMIT
+ { $$ = node_unary(STMT_STATIC_ASSERT, $4); }
;
type