mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-13 22:58:42 +00:00
Changed syntax of expressions. Each `expr' can be now either a numeric literal
or a symbol or parenthesised filter expression.
This commit is contained in:
parent
6be662d917
commit
cc590a11a7
@ -82,12 +82,7 @@ CF_ADDTO(conf, ';')
|
|||||||
|
|
||||||
expr:
|
expr:
|
||||||
NUM
|
NUM
|
||||||
| expr '+' expr { $$ = $1 + $3; }
|
| '(' term ')' { $$ = f_eval_int($2); }
|
||||||
| expr '-' expr { $$ = $1 - $3; }
|
|
||||||
| expr '*' expr { $$ = $1 * $3; }
|
|
||||||
| expr '/' expr { if ($3) $$ = $1 / $3; else cf_error("Division by zero"); }
|
|
||||||
| expr '%' expr { if ($3) $$ = $1 % $3; else cf_error("Division by zero"); }
|
|
||||||
| '(' expr ')' { $$ = $2; }
|
|
||||||
| SYM { if ($1->class != SYM_NUMBER) cf_error("Number expected"); else $$ = $1->aux; }
|
| SYM { if ($1->class != SYM_NUMBER) cf_error("Number expected"); else $$ = $1->aux; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user