From c36a274c633c08115b6006622112f5609031001e Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 19 Feb 2020 03:02:04 +0000 Subject: CTAN sync 202002190302 --- macros/luatex/optex/if-macros.opm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'macros/luatex/optex/if-macros.opm') diff --git a/macros/luatex/optex/if-macros.opm b/macros/luatex/optex/if-macros.opm index c3e4619110..5f3f4d91cf 100644 --- a/macros/luatex/optex/if-macros.opm +++ b/macros/luatex/optex/if-macros.opm @@ -19,9 +19,11 @@ % \loop like in plain\TeX/: -\_def \_loop #1\repeat{\_def\_body{#1}\_iterate} +\_def \_loop #1\_repeat{\_def\_body{#1}\_iterate} +\_def \loop #1\repeat{\_def\_body{#1}\_iterate} +\_let \_repeat=\_fi % this makes \loop...\if...\repeat skippable +\_let \repeat=\_fi \_def \_iterate {\_body \_ea \_iterate \_fi} -\_let \repeat=\fi % this makes \loop...\if...\repeat skippable % \isempty{text}\iftrue, \isempty{text}\iffalse: @@ -38,6 +40,15 @@ \_ea\_tmp#1\_endlistsep#2\_end/_% } +% \isequal{text}{text}\iftrue ... + +\_def\_isequal#1#2#3{\_directlua{% + if "\_luaescapestring{#1}"=="\_luaescapestring{#2}" then else tex.print("\_nbb unless") end}#3} + +% \ismacro\macro{text}\iftrue ... + +\_def\_ismacro#1{\_ea\_isequal\_ea{#1}} + % \isnextchar {exec if true}{exec if false} \_long\_def\_isnextchar#1#2#3{\_begingroup\_toks0={\_endgroup#2}\_toks1={\_endgroup#3}% @@ -62,8 +73,8 @@ \_public - \newif \loop \repeat \isempty \istoksempty \isinlist \isnextchar - \isfile \removespaces ; + \newif \isempty \istoksempty \isinlist \isnextchar + \isfile \ismacro \isequal \removespaces ; \_endcode %--------------------------------------------------------- -- cgit v1.2.3