0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Filter: Make f_method_call_*() usage symmetric

This commit is contained in:
Ondrej Zajicek 2023-06-28 01:21:23 +02:00
parent ab61476ebf
commit c696e3cb8e

View File

@ -866,17 +866,15 @@ static_attr:
| ONLINK { $$ = f_new_static_attr(T_BOOL, SA_ONLINK, 0); } | ONLINK { $$ = f_new_static_attr(T_BOOL, SA_ONLINK, 0); }
; ;
term_dot_method: term '.' { f_method_call_start($1); } method_name_cont { $$ = $4; }; term_dot_method: term '.' { f_method_call_start($1); } method_name_cont { f_method_call_end(); $$ = $4; };
method_name_cont: method_name_cont:
CF_SYM_METHOD_BARE { CF_SYM_METHOD_BARE {
$$ = $1->method->new_inst(FM.object, NULL); $$ = $1->method->new_inst(FM.object, NULL);
f_method_call_end();
} }
| CF_SYM_METHOD_ARGS { | CF_SYM_METHOD_ARGS {
f_method_call_args(); f_method_call_args();
} '(' var_list ')' { } '(' var_list ')' {
$$ = $1->method->new_inst(FM.object, $4); $$ = $1->method->new_inst(FM.object, $4);
f_method_call_end();
} }
; ;
@ -1052,10 +1050,10 @@ cmd:
| CASE term '{' switch_body '}' { | CASE term '{' switch_body '}' {
$$ = f_new_inst(FI_SWITCH, $2, $4); $$ = f_new_inst(FI_SWITCH, $2, $4);
} }
| lvalue '.' { | lvalue '.' {
f_method_call_start(f_lval_getter(&$1)); f_method_call_start(f_lval_getter(&$1));
} method_name_cont ';' { } method_name_cont ';' {
f_method_call_end();
$$ = f_lval_setter(&$1, $4); $$ = f_lval_setter(&$1, $4);
} }
| BT_ASSERT '(' get_cf_position term get_cf_position ')' ';' { $$ = assert_done($4, $3 + 1, $5 - 1); } | BT_ASSERT '(' get_cf_position term get_cf_position ')' ';' { $$ = assert_done($4, $3 + 1, $5 - 1); }