Node:Lexical Structure, Next:Syntax, Up:Input Language
Comments are semantically equivalent to whitespace and can be used anyplace that whitespace is (with one exception in multi-line strings, as described below).
There are two kinds of comments: hash comments, that begin with a
#
character that is not contained within a string and continue
until the next newline, and C-style or bracketed comments, that are
delimited by /*
and */
tokens. The bracketed comments
may span multiple lines. E.g.:
if size :over 100K { # this is a comment discard; } if size :over 100K { /* this is a comment this is still a comment */ discard /* this is a comment again */ ; }
Like in C, bracketed comments do not nest.
The basic lexical entities are identifiers and literals.
An identifier is a sequence of letters, digits and underscores, started
with a letter or underscore. For example, header
and
check_822_again
are valid identifiers, whereas 1st
is not.
A special form of identifier is tag: it is an identifier prefixed
with a colon (:
), e.g.: :comparator
.
A literal is a data that is not executed, merely evaluated "as is", to be used as arguments to commands. There are four kinds of literals:
Numbers are given as ordinary unsigned decimal numbers. An
optional suffix may be used to indicate a multiple of a power of two.
The suffixes are: K
specifying "kibi-", or 1,024 (2^10) times
the value of the number; M
specifying "mebi-", or 1,048,576
(2^20) times the value of the number; and G
specifying "tebi-",
or 1,073,741,824 (2^30) times the value of the number.
The numbers have 32 bits of magnitude.
A string is any sequence of characters enclosed in double quotes
("
). A string cannot contain newlines and double quote
characters. This limitation will disappear in future releases.
A multiline string is used to represent large blocks of text
with embedded newlines and special characters. It starts with the
keyword text:
followed by a newline and ends with a dot
(.
) on a newline by itself. Any characters between these two
markers are taken verbatim. For example:
text: ** This is an authomatic response from my message ** ** filtering program. ** I can not attend your message right now. However it will be saved, and I will read it as soon as I am back. Regards, Fred .
Notice that a hashed comment or whitespace may occur between
text:
and the newline. However, when used inside the multiline
string a hash sign looses its special meaning (except in one case, see
below) and is taken as is, as well as bracketed comment delimiters.
In other words, no comments are allowed within a multiline string. E.g.:
text: # This is a comment Sample text # This line is taken verbatim /* And this line too */ .
The only exception to this rule is that preprocessor include
statement is expanded as usual when found within a multiline string
(see #include), e.g.:
text: #include <myresponse.txt> .
This results in the contents of file myresponse.txt
being read
and interpreted as the contents of the multiline string.
A string list is a comma-delimited list of quoted strings, enclosed
in a pair of square brackets, e.g.:
["[email protected]", "[email protected]"]
For convenience, in any context where a list of strings is appropriate,
a single string is allowed without being a member of a list: it is
equivalent to a list with a single member. For example, the following
two statements are equivalent:
exists "To"; exists ["To"];