Merge remote-tracking branch 'origin/topic/jsiwek/gh-1122'

* origin/topic/jsiwek/gh-1122:
  GH-165: Fix global initializations that indirectly use builtin types
  Improve how primary/top-level BIFs get initialized
  GH-1122: Allow initializing globals with calls to subdir BIFs
  GH-1122: Improve error for global record initialization exceptions
This commit is contained in:
Jon Siwek 2020-09-04 17:24:28 -07:00
commit 2a8de33c63
23 changed files with 207 additions and 70 deletions

View file

@ -5331,3 +5331,13 @@ const digest_salt = "Please change this value." &redef;
global done_with_network = F;
event net_done(t: time)
{ done_with_network = T; }
# This sets up primary BIFs such that they can be used by any
# further scripts within their global initializations and is intended to be
# the last thing done within this script. It's called within @if simply so
# that it executes at parse-time. An alternative way to do that is to call
# it during a global variable assignment/initialization. Formally adding a
# @run directive to the language whose sole purpose is parse-time code
# execution would be another idea.
@if ( __init_primary_bifs() )
@endif

View file

@ -14,3 +14,13 @@
# Load BiFs defined by plugins.
@load base/bif/plugins
# This sets up secondary/subdir BIFs such that they can be used by any
# further scripts within their global initializations and is intended to be
# the last thing done within this script. It's called within @if simply so
# that it executes at parse-time. An alternative way to do that is to call
# it during a global variable assignment/initialization. Formally adding a
# @run directive to the language whose sole purpose is parse-time code
# execution would be another idea.
@if ( __init_secondary_bifs() )
@endif