0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 01:31:55 +00:00
bird/filter
Maria Matejka fc9d471b36 Filter: Methods rework
Methods can now be called as x.m(y), as long as x can have its type
inferred in config time. If used as a command, it modifies the object,
if used as a value, it keeps the original object intact.

Also functions add(x,y), delete(x,y), filter(x,y) and prepend(x,y) now
spit a warning and are considered deprecated.

It's also possible to call a method on a constant, see filter/test.conf
for examples like bgp_path = +empty+.prepend(1).

Inside instruction definitions (filter/f-inst.c), a METHOD_CONSTRUCTOR()
call is added, which registers the instruction as a method for the type
of its first argument. Each type has its own method symbol table and
filter parser switches between them based on the inferred type of the
object calling the method.

Also FI_CLIST_(ADD|DELETE|FILTER) instructions have been split to allow
for this method dispatch. With type inference, it's now possible.
2023-09-12 16:19:33 +02:00
..
config.Y Filter: Methods rework 2023-09-12 16:19:33 +02:00
data.c Filter: Methods rework 2023-09-12 16:19:33 +02:00
data.h Filter: Methods rework 2023-09-12 16:19:33 +02:00
decl.m4 Filter: Methods rework 2023-09-12 16:19:33 +02:00
Doc Doc: Rename code documentation files back to Doc 2018-12-14 02:03:42 +01:00
f-inst.c Filter: Methods rework 2023-09-12 16:19:33 +02:00
f-inst.h Filter: functions can and should have typed return values 2023-09-12 15:58:07 +02:00
f-util.c Moved config-related allocations to config_pool and showing its size in memory usage 2022-11-01 16:38:24 +01:00
filter_test.c Replaced custom linpools in tests for the common tmp_linpool 2022-03-02 12:13:49 +01:00
filter.c Filter: Use more generic approach for intra-config expressions 2023-08-24 04:45:55 +02:00
filter.h Filter: Use more generic approach for intra-config expressions 2023-08-24 04:45:55 +02:00
Makefile Filter: Pre-evaluation of constant expressions 2019-07-02 10:45:53 +02:00
test-reconf-begin.conf Filters: comparison of functions and filters caching 2019-02-26 16:44:24 +01:00
test-reconf-end.conf Filters: comparison of functions and filters caching 2019-02-26 16:44:24 +01:00
test.conf Filter: Methods rework 2023-09-12 16:19:33 +02:00
test.conf2 Filter: Remove quitbird command 2020-05-02 02:47:18 +02:00
test.conf.inc filter/test.conf: Replace print func with assert and format 2016-11-16 12:22:01 +01:00
tree_test.c Replaced custom linpools in tests for the common tmp_linpool 2022-03-02 12:13:49 +01:00
tree.c Filter: Change linearization of branches in switch instruction 2023-01-07 20:18:44 +01:00
trie_test.c Nest: Add tests and benchmark for FIB 2023-05-16 13:25:48 +02:00
trie.c Trie: Fix trie format 2022-02-06 23:27:13 +01:00