summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-16 16:41:25 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-16 16:41:25 -0800
commitcbf768d67d5540681df5e6ea41fe1fb270c95eec (patch)
tree62d5f522c11af3e848bfd4dd8930d441dd8c3633 /doc
parent88ab419cc6f190e52052942943fae7779a22c0e1 (diff)
downloadnasm-cbf768d67d5540681df5e6ea41fe1fb270c95eec.tar.gz
nasm-cbf768d67d5540681df5e6ea41fe1fb270c95eec.tar.bz2
nasm-cbf768d67d5540681df5e6ea41fe1fb270c95eec.zip
Implement %iftoken, test for a single token
Implement %iftoken, a test for a single token. This is useful in cases using %+ to splice a macro-provided token.
Diffstat (limited to 'doc')
-rw-r--r--doc/nasmdoc.src16
1 files changed, 15 insertions, 1 deletions
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src
index e0e44f4..ebb0f15 100644
--- a/doc/nasmdoc.src
+++ b/doc/nasmdoc.src
@@ -2659,7 +2659,6 @@ Like most other \c{%if} constructs, \c{%ifidn} has a counterpart
Similarly, \c{%ifidni} has counterparts \i\c{%elifidni},
\i\c{%ifnidni} and \i\c{%elifnidni}.
-
\S{iftyp} \i\c{%ifid}, \i\c{%ifnum}, \i\c{%ifstr}: Testing Token
Types\I{testing, token types}
@@ -2721,6 +2720,21 @@ which case, all but the first two would be lumped together into
The usual \c{%elifXXX}, \c{%ifnXXX} and \c{%elifnXXX} versions exist
for each of \c{%ifid}, \c{%ifnum} and \c{%ifstr}.
+\S{iftoken} \i\c{%iftoken}: Test For A Single Token
+
+Some macros will want to do different things depending on if it is
+passed a single token (e.g. paste it to something else using \c{%+})
+versus a multi-token sequence.
+
+The conditional assembly construct \c{%iftoken} assembles the
+subsequent code if and only if the expanded parameters consist of
+exactly one token, possibly surrounded by whitespace.
+
+For example, \c{1} will assemble the subsequent code, but \c{-1} will
+not (\c{-} being an operator.)
+
+The usual \i\c{%eliftoken}, \i\c\{%ifntoken}, and \i\c{%elifntoken}
+variants are also provided.
\S{pperror} \i\c{%error}: Reporting \i{User-Defined Errors}