Skip to content

Commit 52848e8

Browse files
author
H. Peter Anvin (Intel)
committed
doc: improve documentation of %ifid et al
Clarify some of the semantics of %ifid, %ifnum, and %ifstr. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1 parent 61265ec commit 52848e8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

doc/changes.src

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ since 2007.
99

1010
\S{cl-2.15.05} Version 2.15.05
1111

12-
\b Correct \c{%ifid $} and \c{%ifid $$} being treated as true. See
13-
\k{iftyp}.
12+
\b Fix \c{%ifid $} and \c{%ifid $$} incorrectly being treated as
13+
true. See \k{iftyp}.
1414

1515
\b Add \c{--reproducible} option to suppress NASM version numbers and
1616
timestamps in output files. See \k{opt-reproducible}.

doc/nasmdoc.src

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3376,9 +3376,13 @@ string.
33763376

33773377
The conditional assembly construct \c{%ifid}, taking one parameter
33783378
(which may be blank), assembles the subsequent code if and only if
3379-
the first token in the parameter exists and is an identifier.
3380-
\c{%ifnum} works similarly, but tests for the token being a numeric
3381-
constant; \c{%ifstr} tests for it being a string.
3379+
\e{the first token} in the parameter exists and is an
3380+
identifier. \c{$} and \c{$$} are \e{not} considered identifiers by
3381+
\c{%ifid}.
3382+
3383+
\c{%ifnum} works similarly, but tests for the token being an integer
3384+
numeric constant (not an expression!) possibly preceeded by \c{+} or
3385+
\c{-}; \c{%ifstr} tests for it being a quoted string.
33823386

33833387
For example, the \c{writefile} macro defined in \k{mlmacgre} can be
33843388
extended to take advantage of \c{%ifstr} in the following fashion:

0 commit comments

Comments
 (0)