zeekygen: Add BIFs to access declaring scripts

Two new BIFs get_identifier_declaring_script() and get_record_field_declaring_script()
mirroring existing functions for comments. This allows to query the declaring
script information from Zeek scripts and further determine if a redef operations
were involved for record fields or enum names by comparing the declaring script
with the one of the involved type. See the tests.

Yet another one of @stevesmoot's requests.
This commit is contained in:
Arne Welzel 2022-10-28 16:38:00 +02:00
parent d65c75e2ad
commit ef166649bf
8 changed files with 196 additions and 5 deletions

View file

@ -0,0 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
get_identifier_declaring_script(""), ""
get_identifier_declaring_script("UnknownRecord"), ""
get_record_field_declaring_script(""), ""
get_record_field_declaring_script("UnknownRecord"), ""
get_record_field_declaring_script("Conn$"), ""
get_record_field_declaring_script("Conn$unknown_field"), ""