mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
Improve documentation of table and set types
Add a list of the types that are not allowed to be the index type of a table or set.
This commit is contained in:
parent
7b6ab180b6
commit
c6dec18e2b
1 changed files with 10 additions and 5 deletions
|
@ -340,15 +340,18 @@ Here is a more detailed description of each type:
|
|||
|
||||
table [ type^+ ] of type
|
||||
|
||||
where *type^+* is one or more types, separated by commas.
|
||||
For example:
|
||||
where *type^+* is one or more types, separated by commas. The
|
||||
index type cannot be any of the following types: pattern, table, set,
|
||||
vector, file, opaque, any.
|
||||
|
||||
Here is an example of declaring a table indexed by "count" values
|
||||
and yielding "string" values:
|
||||
|
||||
.. code:: bro
|
||||
|
||||
global a: table[count] of string;
|
||||
|
||||
declares a table indexed by "count" values and yielding
|
||||
"string" values. The yield type can also be more complex:
|
||||
The yield type can also be more complex:
|
||||
|
||||
.. code:: bro
|
||||
|
||||
|
@ -441,7 +444,9 @@ Here is a more detailed description of each type:
|
|||
|
||||
set [ type^+ ]
|
||||
|
||||
where *type^+* is one or more types separated by commas.
|
||||
where *type^+* is one or more types separated by commas. The
|
||||
index type cannot be any of the following types: pattern, table, set,
|
||||
vector, file, opaque, any.
|
||||
|
||||
Sets can be initialized by listing elements enclosed by curly braces:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue