mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/fix-zeekygen-misassociations'
* origin/topic/jsiwek/fix-zeekygen-misassociations: Fix misassociation of Zeekygen-style comments within function scopes
This commit is contained in:
commit
94366fdfd9
4 changed files with 24 additions and 7 deletions
7
CHANGES
7
CHANGES
|
@ -1,4 +1,11 @@
|
||||||
|
|
||||||
|
3.3.0-dev.611 | 2020-12-07 09:42:37 -0800
|
||||||
|
|
||||||
|
* Fix misassociation of Zeekygen-style comments within function scopes (Jon Siwek, Corelight)
|
||||||
|
|
||||||
|
All Zeekygen-style comments relate to entities at global scope, so those
|
||||||
|
found within functions are now ignored instead of misassociated.
|
||||||
|
|
||||||
3.3.0-dev.609 | 2020-12-04 19:20:39 -0800
|
3.3.0-dev.609 | 2020-12-04 19:20:39 -0800
|
||||||
|
|
||||||
* Remove an extraneous Zeekygen-style comment (Jon Siwek, Corelight)
|
* Remove an extraneous Zeekygen-style comment (Jon Siwek, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
3.3.0-dev.609
|
3.3.0-dev.611
|
||||||
|
|
|
@ -175,6 +175,11 @@ export {
|
||||||
# documentation. So using ``##``-style comments is pointless here.
|
# documentation. So using ``##``-style comments is pointless here.
|
||||||
function function_without_proto(tag: string): string
|
function function_without_proto(tag: string): string
|
||||||
{
|
{
|
||||||
|
# Zeekygen-style comments only apply to entities at global-scope so
|
||||||
|
# Zeekygen doesn't associate the following comments with anything.
|
||||||
|
##! This comment should be ignored by Zeekygen.
|
||||||
|
## This comment should be ignored by Zeekygen.
|
||||||
|
##< This comment should be ignored by Zeekygen.
|
||||||
return "blah";
|
return "blah";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
17
src/scan.l
17
src/scan.l
|
@ -149,19 +149,24 @@ ESCSEQ (\\([^\n]|[0-7]+|x[[:xdigit:]]+))
|
||||||
%%
|
%%
|
||||||
|
|
||||||
##!.* {
|
##!.* {
|
||||||
zeek::detail::zeekygen_mgr->SummaryComment(::filename, yytext + 3);
|
if ( zeek::detail::current_scope() == zeek::detail::global_scope() )
|
||||||
|
zeek::detail::zeekygen_mgr->SummaryComment(::filename, yytext + 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
##<.* {
|
##<.* {
|
||||||
std::string hint(cur_enum_type && last_id_tok ?
|
if ( zeek::detail::current_scope() == zeek::detail::global_scope() )
|
||||||
zeek::detail::make_full_var_name(zeek::detail::current_module.c_str(), last_id_tok) : "");
|
{
|
||||||
|
std::string hint(cur_enum_type && last_id_tok ?
|
||||||
|
zeek::detail::make_full_var_name(zeek::detail::current_module.c_str(), last_id_tok) : "");
|
||||||
|
|
||||||
zeek::detail::zeekygen_mgr->PostComment(yytext + 3, hint);
|
zeek::detail::zeekygen_mgr->PostComment(yytext + 3, hint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
##.* {
|
##.* {
|
||||||
if ( yytext[2] != '#' )
|
if ( zeek::detail::current_scope() == zeek::detail::global_scope() )
|
||||||
zeek::detail::zeekygen_mgr->PreComment(yytext + 2);
|
if ( yytext[2] != '#' )
|
||||||
|
zeek::detail::zeekygen_mgr->PreComment(yytext + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#{OWS}@no-test.* return TOK_NO_TEST;
|
#{OWS}@no-test.* return TOK_NO_TEST;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue