mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Allow default function/hook/event parameters. Addresses #972.
And changed the endianness parameter of bytestring_to_count() BIF to default to false (big endian), mostly just to prove that the BIF parser doesn't choke on default parameters.
This commit is contained in:
parent
69c7363147
commit
e2a1d4a233
14 changed files with 239 additions and 28 deletions
|
@ -26,6 +26,7 @@ int check_c_mode(int t)
|
|||
%}
|
||||
|
||||
WS [ \t]+
|
||||
OWS [ \t]*
|
||||
/* Note, bifcl only accepts a single "::" in IDs while the policy
|
||||
layer acceptes multiple. (But the policy layer doesn't have
|
||||
a hierachy. */
|
||||
|
@ -101,7 +102,13 @@ HEX [0-9a-fA-F]+
|
|||
return TOK_ID;
|
||||
}
|
||||
|
||||
&{ID} {
|
||||
/*
|
||||
Hacky way to pass along arbitrary attribute expressions since the BIF parser
|
||||
has little understanding of valid Bro expressions. With this pattern, the
|
||||
attribute expression should stop when it reaches another attribute, another
|
||||
function argument, or the end of the function declaration.
|
||||
*/
|
||||
&{ID}({OWS}={OWS}[^&%;,]+)? {
|
||||
int t = check_c_mode(TOK_ATTR);
|
||||
|
||||
if ( t == TOK_ATTR )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue