@end ifset
@node Irp
-@section @code{.irp @var{symbol},@var{values}}@dots{}
+@section @code{.irp @var{symbol},@var{value}}@dots{}
@cindex @code{irp} directive
Evaluate a sequence of statements assigning different values to @var{symbol}.
@cindex @code{irpc} directive
Evaluate a sequence of statements assigning different values to @var{symbol}.
-The sequence of statements starts at the @code{.irpc} directive, and is
-terminated by an @code{.endr} directive. For each character in @var{value},
-@var{symbol} is set to the character, and the sequence of statements is
-assembled. If no @var{value} is listed, the sequence of statements is
-assembled once, with @var{symbol} set to the null string. To refer to
-@var{symbol} within the sequence of statements, use @var{\symbol}.
+The sequence of statements starts at the line following the @code{.irpc}
+directive, and is terminated by an @code{.endr} directive. For each character
+in each (possibly double quoted) @var{values}, @var{symbol} is set to the
+character, and the sequence of statements is assembled. If no @var{values} is
+listed, the sequence of statements is assembled once, with @var{symbol} set to
+the null string. To refer to @var{symbol} within the sequence of statements,
+use @var{\symbol}.
For example, assembling
{
bool in_quotes = false;
- if (irpc && in->ptr[idx] == '"')
- {
- in_quotes = true;
- ++idx;
- }
-
while (idx < in->len)
{
if (!irpc)
{
if (in->ptr[idx] == '"')
{
- size_t nxt;
+ in_quotes = ! in_quotes;
+ ++idx;
- if (irpc)
- in_quotes = ! in_quotes;
-
- nxt = sb_skip_white (idx + 1, in);
- if (nxt >= in->len)
+ if (! in_quotes)
{
- idx = nxt;
- break;
+ idx = sb_skip_white (idx, in);
+ if (idx >= in->len)
+ break;
}
}
sb_reset (&f.actual);