mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Trivial 15-line bison excercise: Implemented expressions including
user-defined numeric symbols. Whenever possible, use `expr' instead of `NUM' to get full express ion power :-)
This commit is contained in:
@@ -54,9 +54,10 @@ proto_name:
|
||||
|
||||
proto_item:
|
||||
/* EMPTY */
|
||||
| PREFERENCE NUM {
|
||||
| PREFERENCE expr {
|
||||
if ($2 < 0 || $2 > 255) cf_error("Invalid preference");
|
||||
this_proto->preference = $2;
|
||||
die("pref=%d", $2);
|
||||
}
|
||||
;
|
||||
|
||||
|
Reference in New Issue
Block a user