mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 04:28:20 +00:00
Merge branch 'topic/robin/extend-records' into topic/robin/logging-internals
Includes some fixes for using &log with record-extension.
This commit is contained in:
commit
1cbde793d8
8 changed files with 118 additions and 8 deletions
20
src/parse.y
20
src/parse.y
|
@ -862,7 +862,25 @@ decl:
|
|||
'{' { parser_redef_enum($3); } enum_body '}' ';'
|
||||
{ /* no action */ }
|
||||
|
||||
| TOK_TYPE def_global_id ':' refined_type opt_attr ';'
|
||||
| TOK_REDEF TOK_RECORD global_id TOK_ADD_TO
|
||||
'{' type_decl_list '}' opt_attr ';'
|
||||
{
|
||||
if ( ! $3->Type() )
|
||||
$3->Error("unknown identifier");
|
||||
else
|
||||
{
|
||||
RecordType* add_to = $3->Type()->AsRecordType();
|
||||
if ( ! add_to )
|
||||
$3->Error("not a record type");
|
||||
else {
|
||||
const char* error = add_to->AddFields($6, $8);
|
||||
if ( error )
|
||||
$3->Error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
| TOK_TYPE global_id ':' refined_type opt_attr ';'
|
||||
{
|
||||
add_type($2, $4, $5, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue