hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/sfinae.y
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-19 11:52:25 +0200
committerhachem <im@hachem.wtf>2026-09-19 11:52:25 +0200
commitb20c46c555986a99be70de61d91bc225e53f31d2 (patch)
tree7c3b94ca7cd894e0597bcef65f5f19ea9f1e7ecd /sfinae.y
parentdd52ccd9319aa847cddc486519075b806c9e9092 (diff)
eval: sum product and quotient
Diffstat (limited to 'sfinae.y')
-rw-r--r--sfinae.y9
1 files changed, 9 insertions, 0 deletions
diff --git a/sfinae.y b/sfinae.y
index 2e91b23..3e7c9b1 100644
--- a/sfinae.y
+++ b/sfinae.y
@@ -20,6 +20,9 @@ void yyerror(const char* message);
%token TOK_COMMIT
%token TOK_DECLTYPE
%token TOK_DIFFERENCE
+%token TOK_SUM
+%token TOK_PRODUCT
+%token TOK_QUOTIENT
%token <character> TOK_CHAR
%type <node> statements statement type value
@@ -51,6 +54,12 @@ type
value
: TOK_COLONCOLON TOK_DIFFERENCE '<' TOK_CHAR ',' TOK_CHAR '>'
{ $$ = node_binary(VALUE_DIFFERENCE, node_char($4), node_char($6)); }
+ | TOK_COLONCOLON TOK_SUM '<' value ',' value '>'
+ { $$ = node_binary(VALUE_SUM, $4, $6); }
+ | TOK_COLONCOLON TOK_PRODUCT '<' value ',' value '>'
+ { $$ = node_binary(VALUE_PRODUCT, $4, $6); }
+ | TOK_COLONCOLON TOK_QUOTIENT '<' value ',' value '>'
+ { $$ = node_binary(VALUE_QUOTIENT, $4, $6); }
;
%%