mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 01:31:55 +00:00
fc9d471b36
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. |
||
---|---|---|
.. | ||
config.Y | ||
data.c | ||
data.h | ||
decl.m4 | ||
Doc | ||
f-inst.c | ||
f-inst.h | ||
f-util.c | ||
filter_test.c | ||
filter.c | ||
filter.h | ||
Makefile | ||
test-reconf-begin.conf | ||
test-reconf-end.conf | ||
test.conf | ||
test.conf2 | ||
test.conf.inc | ||
tree_test.c | ||
tree.c | ||
trie_test.c | ||
trie.c |