mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-08 12:18:42 +00:00
Allow accessing defined symbols.
This commit is contained in:
parent
cc590a11a7
commit
cbfd671f11
@ -348,6 +348,15 @@ term:
|
||||
| SYM {
|
||||
$$ = f_new_inst();
|
||||
switch ($1->class) {
|
||||
case SYM_NUMBER:
|
||||
$$ = f_new_inst();
|
||||
$$->code = 'c';
|
||||
$$->aux = T_INT;
|
||||
$$->a2.i = $1->aux;
|
||||
break;
|
||||
case SYM_IPA:
|
||||
{ NEW_F_VAL; $$ = f_new_inst(); $$->code = 'C'; $$->a1.p = val; val->type = T_IP; val->val.px.ip = * (ip_addr *) ($1->def); }
|
||||
break;
|
||||
case SYM_VARIABLE | T_INT:
|
||||
case SYM_VARIABLE | T_PAIR:
|
||||
case SYM_VARIABLE | T_PREFIX:
|
||||
|
@ -65,13 +65,16 @@ function bla()
|
||||
return 15;
|
||||
}
|
||||
|
||||
define four=4;
|
||||
define onetwo=1.2.3.4;
|
||||
|
||||
function __startup()
|
||||
int i;
|
||||
prefix px;
|
||||
ip p;
|
||||
{
|
||||
print "Testing filter language:";
|
||||
i = 4;
|
||||
i = four;
|
||||
i = 1230 + i;
|
||||
i = ( i + 0 );
|
||||
print " arithmetics: 1234 = ", i;
|
||||
@ -111,6 +114,8 @@ ip p;
|
||||
|
||||
paths();
|
||||
|
||||
print "1.2.3.4 = ", onetwo;
|
||||
|
||||
print "done";
|
||||
quitbird;
|
||||
# print "*** FAIL: this is unreachable";
|
||||
|
Loading…
Reference in New Issue
Block a user