/usr/share/doc/mailutils-doc/mailutils.html/Lexical-Structure.html is in mailutils-doc 1:3.1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Published by the Free Software Foundation,
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA
Copyright (C) 1999-2004, 2008-2012, 2014-2016 Free Software
Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover, and no Back-Cover texts.
A copy of the license is included in the section entitled "GNU Free
Documentation License". -->
<!-- Created by GNU Texinfo 6.3, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Mailutils Manual: Lexical Structure</title>
<meta name="description" content="GNU Mailutils Manual: Lexical Structure">
<meta name="keywords" content="GNU Mailutils Manual: Lexical Structure">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Function-Index.html#Function-Index" rel="index" title="Function Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Sieve-Language.html#Sieve-Language" rel="up" title="Sieve Language">
<link href="Syntax.html#Syntax" rel="next" title="Syntax">
<link href="Sieve-Language.html#Sieve-Language" rel="prev" title="Sieve Language">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<a name="Lexical-Structure"></a>
<div class="header">
<p>
Next: <a href="Syntax.html#Syntax" accesskey="n" rel="next">Syntax</a>, Up: <a href="Sieve-Language.html#Sieve-Language" accesskey="u" rel="up">Sieve Language</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-Index.html#Function-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Lexical-Structure-1"></a>
<h3 class="section">5.1 Lexical Structure</h3>
<a name="Whitespace-and-Comments"></a>
<h4 class="subheading">Whitespace and Comments</h4>
<p>Comments are semantically equivalent to whitespace and can be used
anyplace that whitespace is (with one exception in multi-line strings,
as described below).
</p>
<p>There are two kinds of comments: hash comments, that begin with a
‘<samp>#</samp>’ character that is not contained within a string and continue
until the next newline, and C-style or bracketed comments, that are
delimited by ‘<samp>/*</samp>’ and ‘<samp>*/</samp>’ tokens. The bracketed comments
may span multiple lines. E.g.:
</p>
<div class="smallexample">
<pre class="smallexample">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
*/ ;
}
</pre></div>
<p>Like in C, bracketed comments do not nest.
</p>
<a name="Lexical-Tokens"></a>
<h4 class="subheading">Lexical Tokens</h4>
<p>The basic lexical entities are <em>identifiers</em> and <em>literals</em>.
</p>
<p>An <em>identifier</em> is a sequence of letters, digits and underscores,
that begins with a letter or underscore. For example, <code>header</code> and
<code>check_822_again</code> are valid identifiers, whereas <code>1st</code> is not.
A special form of identifier is <em>tag</em>: it is an identifier prefixed
with a colon (‘<samp>:</samp>’), e.g.: <code>:comparator</code>.
</p>
<p>A <em>literal</em> is a data that is not executed, merely evaluated “as
is”, to be used as arguments to commands. There are four kinds of
literals:
</p>
<ul>
<li> Number
<a name="index-numbers_002c-sieve"></a>
<p><em>Numbers</em> 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: ‘<samp>K</samp>’ specifying “kibi-”, or 1,024 (2^10) times
the value of the number; ‘<samp>M</samp>’ specifying “mebi-”, or 1,048,576
(2^20) times the value of the number; and ‘<samp>G</samp>’ specifying “tebi-”,
or 1,073,741,824 (2^30) times the value of the number.
</p>
<p>The numbers have 32 bits of magnitude.
</p>
</li><li> String
<a name="index-strings_002c-sieve"></a>
A <em>string</em> is any sequence of characters enclosed in double quotes
(‘<samp>"</samp>’). A string cannot contain newlines and double quote
characters. This limitation will disappear in future releases.
</li><li> Multiline Strings
<a name="index-multiline-strings_002c-sieve"></a>
<a name="index-text_003a"></a>
A <em>multiline string</em> is used to represent large blocks of text
with embedded newlines and special characters. It starts with the
keyword <code>text:</code> followed by a newline and ends with a dot
(‘<samp>.</samp>’) on a newline by itself. Any characters between these two
markers are taken verbatim. For example:
<div class="smallexample">
<pre class="smallexample">text:
** This is an automatic 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
.
</pre></div>
<p>Notice that a hashed comment or whitespace may occur between
<code>text:</code> 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.:
</p>
<div class="smallexample">
<pre class="smallexample">text: # This is a comment
Sample text
# This line is taken verbatim
/* And this line too */
.
</pre></div>
<p>The only exception to this rule is that preprocessor <code>include</code>
statement is expanded as usual when found within a multiline string
(see <a href="Preprocessor.html#Preprocessor">Preprocessor</a>), e.g.:
</p>
<div class="smallexample">
<pre class="smallexample">text:
#include <myresponse.txt>
.
</pre></div>
<p>This results in the contents of file <samp>myresponse.txt</samp> being read
and interpreted as the contents of the multiline string.
</p>
<p>GNU libmu_sieve extends the described syntax as follows. If the keyword
<code>text:</code> is immediately followed by a dash (‘<samp>-</samp>’), then all
leading tab characters are stripped from input lines and the line
containing delimiter (‘<samp>.</samp>’). This allows multiline strings within
scripts to be indented in a natural fashion.
</p>
<p>Furthermore, if the <code>text:</code> (optionally followed by ‘<samp>-</samp>’) is
immediately followed by a word, this word will be used as ending
delimiter of multiline string instead of the default dot. For
example:
</p>
<div class="smallexample">
<pre class="smallexample">if header "from" "me@example.com"
{
reject text:-EOT
I do not accept messages from
this address.
.
.
EOT
# Notice that this the multiline string ends here.
# The single dots above will be part of it.
;
}
</pre></div>
</li><li> String Lists
<a name="index-string-list_002c-sieve"></a>
<p>A <em>string list</em> is a comma-delimited list of quoted strings, enclosed
in a pair of square brackets, e.g.:
</p>
<div class="smallexample">
<pre class="smallexample">["me@example.com", "me00@landru.example.edu"]
</pre></div>
<p>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:
</p>
<div class="smallexample">
<pre class="smallexample">exists "To";
exists ["To"];
</pre></div>
</li></ul>
<hr>
<div class="header">
<p>
Next: <a href="Syntax.html#Syntax" accesskey="n" rel="next">Syntax</a>, Up: <a href="Sieve-Language.html#Sieve-Language" accesskey="u" rel="up">Sieve Language</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-Index.html#Function-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|