type/id/zeekygen: Add EnumVal to enum identifiers

Provide a direct way to go from a zeek🆔:ID value to EnumVal without
needing to go through the type.
This commit is contained in:
Arne Welzel 2025-04-03 16:39:28 +02:00
parent f0ccd5c7f8
commit 18597ea49c
2 changed files with 11 additions and 1 deletions

View file

@ -481,6 +481,10 @@ void ID::DescribeReST(ODesc* d, bool roles_only) const {
}
if ( val && type && type->Tag() != TYPE_FUNC && type->InternalType() != TYPE_INTERNAL_VOID &&
// Do not include a default value for enum const identifiers,
// as their value can't be changed.
! IsEnumConst() &&
// Values within Version module are likely to include a
// constantly-changing version number and be a frequent
// source of error/desynchronization, so don't include them.