summaryrefslogtreecommitdiff
path: root/conf
diff options
context:
space:
mode:
authorAlexander Zubkov <green@qrator.net>2023-08-24 04:45:55 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-08-24 04:45:55 +0200
commit0dbcc927260c6da918fa1bd78c86800e41ab05a8 (patch)
treee147628288e204afe717bef47a779cd6c4b92bea /conf
parentfc3547880aafad726509f0514df2d5e0bb140728 (diff)
Filter: Use more generic approach for intra-config expressions
Replace f_eval_int() function with a type-generic variant: cf_eval(). Implement similar fuction: cf_eval_int() via inline call to cf_eval().
Diffstat (limited to 'conf')
-rw-r--r--conf/confbase.Y4
1 files changed, 2 insertions, 2 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y
index da750d38..e109ddf5 100644
--- a/conf/confbase.Y
+++ b/conf/confbase.Y
@@ -155,14 +155,14 @@ conf: definition ;
definition:
DEFINE symbol '=' term ';' {
struct f_val *val = cfg_allocz(sizeof(struct f_val));
- if (f_eval(f_linearize($4, 1), cfg_mem, val) > F_RETURN) cf_error("Runtime error");
+ *val = cf_eval($4, T_VOID);
cf_define_symbol($2, SYM_CONSTANT | val->type, val, val);
}
;
expr:
NUM
- | '(' term ')' { $$ = f_eval_int(f_linearize($2, 1)); }
+ | '(' term ')' { $$ = cf_eval_int($2); }
| CF_SYM_KNOWN {
if ($1->class != (SYM_CONSTANT | T_INT)) cf_error("Number constant expected");
$$ = SYM_VAL($1).i; }