diff options
authorH. Peter Anvin (Intel) <hpa@zytor.com>2020-09-04 11:33:38 -0700
committerH. Peter Anvin (Intel) <hpa@zytor.com>2020-09-11 16:28:57 -0700
commit52848e8abacb690d1a4eeb5055aca8303ca06fca (patch)
parent61265ecd15836a2d1fe696a6befcbc9a77cb39a0 (diff)
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>
2 files changed, 9 insertions, 5 deletions
diff --git a/doc/changes.src b/doc/changes.src
index 7b9665a2..8aab8fc5 100644
--- a/doc/changes.src
+++ b/doc/changes.src
@@ -9,8 +9,8 @@ since 2007.
\S{cl-2.15.05} Version 2.15.05
-\b Correct \c{%ifid $} and \c{%ifid $$} being treated as true. See
+\b Fix \c{%ifid $} and \c{%ifid $$} incorrectly being treated as
+true. See \k{iftyp}.
\b Add \c{--reproducible} option to suppress NASM version numbers and
timestamps in output files. See \k{opt-reproducible}.
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src
index efbf3b23..3c4f2093 100644
--- a/doc/nasmdoc.src
+++ b/doc/nasmdoc.src
@@ -3376,9 +3376,13 @@ string.
The conditional assembly construct \c{%ifid}, taking one parameter
(which may be blank), assembles the subsequent code if and only if
-the first token in the parameter exists and is an identifier.
-\c{%ifnum} works similarly, but tests for the token being a numeric
-constant; \c{%ifstr} tests for it being a string.
+\e{the first token} in the parameter exists and is an
+identifier. \c{$} and \c{$$} are \e{not} considered identifiers by
+\c{%ifnum} works similarly, but tests for the token being an integer
+numeric constant (not an expression!) possibly preceeded by \c{+} or
+\c{-}; \c{%ifstr} tests for it being a quoted string.
For example, the \c{writefile} macro defined in \k{mlmacgre} can be
extended to take advantage of \c{%ifstr} in the following fashion: