diff --git a/src/parse.y b/src/parse.y index e5e0627e06..6e8b4dc327 100644 --- a/src/parse.y +++ b/src/parse.y @@ -1058,7 +1058,7 @@ formal_args_decl: TOK_ID ':' type opt_attr { set_location(@1, @4); - $$ = new TypeDecl($3, $1, $4); + $$ = new TypeDecl($3, $1, $4, true); } ; diff --git a/testing/btest/Baseline/language.default-params/out b/testing/btest/Baseline/language.default-params/out index 0ae804cc6b..f874ca3fe3 100644 --- a/testing/btest/Baseline/language.default-params/out +++ b/testing/btest/Baseline/language.default-params/out @@ -3,6 +3,19 @@ foo_func, hello bar_func, hmm, hi, 5 bar_func, cool, beans, 5 bar_func, cool, beans, 13 +begin table_func, { + +} +end table_func, { +[the test] = works +} +begin table_func, { +[initial] = conditions +} +end table_func, { +[initial] = conditions, +[the test] = works +} foo_hook, test foo_hook, hello bar_hook, hmm, hi, 5 diff --git a/testing/btest/language/default-params.zeek b/testing/btest/language/default-params.zeek index c07bdee207..6543ec85d1 100644 --- a/testing/btest/language/default-params.zeek +++ b/testing/btest/language/default-params.zeek @@ -16,6 +16,13 @@ function bar_func(a: string, b: string &default="hi", c: count &default=5) print "bar_func", a, b, c; } +function table_func(a: table[string] of string &default=table()) + { + print "begin table_func", a; + a["the test"] = "works"; + print "end table_func", a; + } + ### events global foo_event: event(a: string &default="hello"); @@ -51,6 +58,8 @@ foo_func(); bar_func("hmm"); bar_func("cool", "beans"); bar_func("cool", "beans", 13); +table_func(); +table_func(table(["initial"] = "conditions")); event foo_event("test"); event foo_event();