mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00

- Identifiers that are initialized with set()/table() constructor expressions now inherit attributes from the expression. Before, statements like const i: set[string] = set() &redef; associated the attribute with the set() constructor, but not the "i" identifier, preventing redefinition. Addresses #866. - Allow &default attribute to apply to tables initialized as empty (via either "{ }" or "table()") or if the expression supplied to it can evaluate to a type that's promotable to the same yield type as the table.
91 lines
546 B
Text
91 lines
546 B
Text
my_set_ctor_init
|
|
{
|
|
test2,
|
|
test3,
|
|
test4,
|
|
test1
|
|
}
|
|
|
|
my_table_ctor_init
|
|
{
|
|
[2] = test2,
|
|
[1] = test1,
|
|
[3] = test3
|
|
}
|
|
nope
|
|
|
|
my_set_init
|
|
{
|
|
test2,
|
|
test3,
|
|
test4,
|
|
test1
|
|
}
|
|
|
|
my_table_init
|
|
{
|
|
[2] = test2,
|
|
[4] = test4,
|
|
[1] = test1,
|
|
[3] = test3
|
|
}
|
|
nope
|
|
|
|
inception
|
|
{
|
|
[0] = {
|
|
[13] = bar
|
|
}
|
|
}
|
|
{
|
|
[13] = bar
|
|
}
|
|
bar
|
|
forty-two
|
|
{
|
|
|
|
}
|
|
we need to go deeper
|
|
{
|
|
[0] = {
|
|
[13] = bar
|
|
}
|
|
}
|
|
{
|
|
[13] = bar
|
|
}
|
|
bar
|
|
forty-two
|
|
{
|
|
|
|
}
|
|
we need to go deeper
|
|
|
|
local table t1
|
|
{
|
|
[1] = foo
|
|
}
|
|
foo
|
|
nope
|
|
|
|
local table t2
|
|
{
|
|
[1] = foo
|
|
}
|
|
foo
|
|
nope
|
|
|
|
local table t3
|
|
{
|
|
|
|
}
|
|
nope
|
|
nope
|
|
|
|
local table t4
|
|
{
|
|
|
|
}
|
|
nope
|
|
nope
|
|
|