From c6dec18e2b913f259fd6bae8efef61913ff4a501 Mon Sep 17 00:00:00 2001 From: Daniel Thayer Date: Mon, 17 Aug 2015 16:24:02 -0500 Subject: [PATCH] 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. --- doc/script-reference/types.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/script-reference/types.rst b/doc/script-reference/types.rst index cc601db75f..847e0f8fab 100644 --- a/doc/script-reference/types.rst +++ b/doc/script-reference/types.rst @@ -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: