[nasm:nasm-2.15.xx] doc: improve documentation of %ifid et al

nasm-bot for H. Peter Anvin (Intel) hpa at zytor.com
Fri Sep 11 18:15:10 PDT 2020


Commit-ID:  52848e8abacb690d1a4eeb5055aca8303ca06fca
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=52848e8abacb690d1a4eeb5055aca8303ca06fca
Author:     H. Peter Anvin (Intel) <hpa at zytor.com>
AuthorDate: Fri, 4 Sep 2020 11:33:38 -0700
Committer:  H. Peter Anvin (Intel) <hpa at zytor.com>
CommitDate: Fri, 11 Sep 2020 16:28:57 -0700

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 at zytor.com>


---
 doc/changes.src |  4 ++--
 doc/nasmdoc.src | 10 +++++++---
 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
-\k{iftyp}.
+\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{%ifid}.
+
+\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:


More information about the Nasm-commits mailing list