mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Teach Zeekygen to produce source-code-range information
Related to https://github.com/zeek/zeek-docs/issues/56
This commit is contained in:
parent
c95a364ff7
commit
6ac499882c
16 changed files with 147 additions and 7 deletions
|
@ -18,6 +18,7 @@
|
|||
#include "zeek/zeekygen/Manager.h"
|
||||
#include "zeek/zeekygen/IdentifierInfo.h"
|
||||
#include "zeek/zeekygen/ScriptInfo.h"
|
||||
#include "zeek/zeekygen/utils.h"
|
||||
#include "zeek/module_util.h"
|
||||
|
||||
namespace zeek {
|
||||
|
@ -492,7 +493,15 @@ void ID::DescribeReST(ODesc* d, bool roles_only) const
|
|||
d->Add(".. zeek:type:: ");
|
||||
else
|
||||
d->Add(".. zeek:id:: ");
|
||||
|
||||
d->Add(name);
|
||||
|
||||
if ( auto sc = zeek::zeekygen::detail::source_code_range(this) )
|
||||
{
|
||||
d->PushIndent();
|
||||
d->Add(util::fmt(":source-code: %s", sc->data()));
|
||||
d->PopIndentNoNL();
|
||||
}
|
||||
}
|
||||
|
||||
d->PushIndent();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue