mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Add deprecation expression to deprecated prototype/parameter messages
This commit is contained in:
parent
ac1ec7668d
commit
8597b998bb
7 changed files with 58 additions and 25 deletions
|
@ -294,14 +294,7 @@ std::string ID::GetDeprecationWarning() const
|
|||
const auto& depr_attr = GetAttr(ATTR_DEPRECATED);
|
||||
|
||||
if ( depr_attr )
|
||||
{
|
||||
auto expr = static_cast<zeek::detail::ConstExpr*>(depr_attr->GetExpr().get());
|
||||
if ( expr )
|
||||
{
|
||||
StringVal* text = expr->Value()->AsStringVal();
|
||||
result = text->CheckString();
|
||||
}
|
||||
}
|
||||
result = depr_attr->DeprecationMessage();
|
||||
|
||||
if ( result.empty() )
|
||||
return fmt("deprecated (%s)", Name());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue