From 550d418660a6918df3b81698f264a6f0bdd000ce Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 10 Jul 2012 00:00:17 +0300 Subject: beta 2012.07.09 22:35 --- tex/context/base/syst-aux.mkiv | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'tex/context/base/syst-aux.mkiv') 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, -- cgit v1.2.3