summaryrefslogtreecommitdiffstats
path: root/dimension/common.rules
diff options
context:
space:
mode:
Diffstat (limited to 'dimension/common.rules')
-rw-r--r--dimension/common.rules22
1 files changed, 22 insertions, 0 deletions
diff --git a/dimension/common.rules b/dimension/common.rules
index e5b9e67..c8e0767 100644
--- a/dimension/common.rules
+++ b/dimension/common.rules
@@ -453,6 +453,12 @@ ARITH_EXPR: FLOAT_LITERAL
| "log" "(" ARITH_EXPR ")" {
$$ = dmnsn_new_astnode1(DMNSN_AST_LOG, @$, $3);
}
+ | "max" "(" MAX_LIST ")" {
+ $$ = $3;
+ }
+ | "min" "(" MIN_LIST ")" {
+ $$ = $3;
+ }
| "mod" "(" ARITH_EXPR "," ARITH_EXPR ")" {
$$ = dmnsn_new_astnode2(DMNSN_AST_MOD, @$, $3, $5);
}
@@ -501,6 +507,22 @@ ARITH_EXPR: FLOAT_LITERAL
| "t" { $$ = dmnsn_new_ast_ivector(0, 0, 0, 1, 0); }
;
+MAX_LIST: ARITH_EXPR "," ARITH_EXPR {
+ $$ = dmnsn_new_astnode2(DMNSN_AST_MAX, @$, $1, $3);
+ }
+ | MAX_LIST "," ARITH_EXPR {
+ $$ = dmnsn_new_astnode2(DMNSN_AST_MAX, @$, $1, $3);
+ }
+;
+
+MIN_LIST: ARITH_EXPR "," ARITH_EXPR {
+ $$ = dmnsn_new_astnode2(DMNSN_AST_MIN, @$, $1, $3);
+ }
+ | MIN_LIST "," ARITH_EXPR {
+ $$ = dmnsn_new_astnode2(DMNSN_AST_MIN, @$, $1, $3);
+ }
+;
+
/* Colors */
COLOR: COLOR_BODY {