mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
bifcl: Keep zeekygen comments close to their definitions
The Yacc grammar treats comments like other whitespace and when seeing the first definition in a file would previously emit all whitespace before emitting the `export` section containing the definition. This lead to the first definition being separated from their zeekygen documention (separated by `export {`). With this patch we start the export section before emitting whitespace. While this might now pull more "whitespace" into the exported part, it avoids breaking the association between zeekygen comments and definitions. Closes #15.
This commit is contained in:
parent
e080c5c6b2
commit
09d3268740
1 changed files with 1 additions and 1 deletions
|
@ -327,8 +327,8 @@ definitions: definitions definition opt_ws
|
|||
}
|
||||
| opt_ws
|
||||
{
|
||||
fprintf(fp_zeek_init, "%s", $1);
|
||||
fprintf(fp_zeek_init, "export {\n");
|
||||
fprintf(fp_zeek_init, "%s", $1);
|
||||
}
|
||||
;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue