mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38: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
12
src/Attr.cc
12
src/Attr.cc
|
@ -40,6 +40,18 @@ Attr::Attr(AttrTag t)
|
|||
void Attr::SetAttrExpr(ExprPtr e)
|
||||
{ expr = std::move(e); }
|
||||
|
||||
std::string Attr::DeprecationMessage() const
|
||||
{
|
||||
if ( tag != ATTR_DEPRECATED )
|
||||
return "";
|
||||
|
||||
if ( ! expr )
|
||||
return "";
|
||||
|
||||
auto ce = static_cast<zeek::detail::ConstExpr*>(expr.get());
|
||||
return ce->Value()->AsStringVal()->CheckString();
|
||||
}
|
||||
|
||||
void Attr::Describe(ODesc* d) const
|
||||
{
|
||||
AddTag(d);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue