summaryrefslogtreecommitdiff
path: root/tex/context/base/syst-aux.mkiv
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-07-10 00:00:17 +0300
committerMarius <mariausol@gmail.com>2012-07-10 00:00:17 +0300
commit550d418660a6918df3b81698f264a6f0bdd000ce (patch)
tree4142120451a916c5436854600b58ca85eb969301 /tex/context/base/syst-aux.mkiv
parent649b8a602cb63bc615c6b32ef35916c92ccfbaa8 (diff)
downloadcontext-550d418660a6918df3b81698f264a6f0bdd000ce.tar.gz
beta 2012.07.09 22:35
Diffstat (limited to 'tex/context/base/syst-aux.mkiv')
-rw-r--r--tex/context/base/syst-aux.mkiv29
1 files changed, 21 insertions, 8 deletions
diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv
index 74dd076f7..0571fd00f 100644
--- a/tex/context/base/syst-aux.mkiv
+++ b/tex/context/base/syst-aux.mkiv
@@ -1321,20 +1321,19 @@
\fi}
%D \macros
-%D {doifnumberelse}
+%D {doifnumberelse,doifnumber,doifnotnumber}
%D
-%D The next macro executes a command depending of the outcome
-%D of a test on numerals. This is probably one of the fastest
-%D test possible, exept from a less robust 10||step
-%D \type{\if}||ladder or some tricky \type{\lcode} checking.
+%D The next macro executes a command depending of the outcome of a test on
+%D numerals. This is probably one of the fastest test possible, exept from
+%D a less robust 10||step \type {\if}||ladder or some tricky \type {\lcode}
+%D checking.
%D
%D \starttyping
%D \doifnumberelse {string} {then ...} {else ...}
%D \stoptyping
%D
-%D The macro accepts \type{123}, \type{abc}, \type{{}},
-%D \type{\getal} and \type{\the\count...}. This macro is a
-%D rather dirty one.
+%D The macro accepts \type {123}, \type {abc}, \type {{}}, \type {\getal} and
+%D \type {\the\count...}. This macro is a rather dirty one.
\def\doifnumberelse#1% does not accept counters (fully expandable)
{\ifcase0\ifcase1#1\or\or\or\or\or\or\or\or\or\else1\fi\space
@@ -1343,6 +1342,20 @@
\expandafter\firstoftwoarguments
\fi}
+\def\doifnumber#1%
+ {\ifcase0\ifcase1#1\or\or\or\or\or\or\or\or\or\else1\fi\space
+ \expandafter\firstofoneargument
+ \else
+ \expandafter\gobbleoneargument
+ \fi}
+
+\def\doifnotnumber#1%
+ {\ifcase0\ifcase1#1\or\or\or\or\or\or\or\or\or\else1\fi\space
+ \expandafter\gobbleoneargument
+ \else
+ \expandafter\firstofoneargument
+ \fi}
+
%D \macros
%D {makerawcommalist,
%D rawdoinsetelse,