From b20c46c555986a99be70de61d91bc225e53f31d2 Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 19 Sep 2026 11:52:25 +0200 Subject: eval: sum product and quotient --- sfinae.y | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sfinae.y') 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 TOK_CHAR %type 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); } ; %% -- cgit v1.3