From 3668eb2ecc0f7dcc6c44fd1e971cbe37fa010fd6 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 2 Aug 2019 21:03:52 +0200 Subject: 2019-08-02 19:47:00 --- tex/context/base/mkiv/syst-lua.mkiv | 45 ++++++++++++++----------------------- 1 file changed, 17 insertions(+), 28 deletions(-) (limited to 'tex/context/base/mkiv/syst-lua.mkiv') diff --git a/tex/context/base/mkiv/syst-lua.mkiv b/tex/context/base/mkiv/syst-lua.mkiv index a9905c7cc..3683f9ed8 100644 --- a/tex/context/base/mkiv/syst-lua.mkiv +++ b/tex/context/base/mkiv/syst-lua.mkiv @@ -24,31 +24,31 @@ %D {\expanded} primitive were mentioned in talks.} trip. For now I don't really see %D other useful applications. -\def\expandeddoif#1#2% +\def\expandeddoifelse#1#2% {\immediateassignment\edef\m_syst_string_one{#1}% \immediateassignment\edef\m_syst_string_two{#2}% \ifx\m_syst_string_one\m_syst_string_two - \expandafter\firstofoneargument + \expandafter\firstoftwoarguments \else - \expandafter\gobbleoneargument + \expandafter\secondoftwoarguments \fi} -\def\expandeddoifnot#1#2% +\def\expandeddoif#1#2% {\immediateassignment\edef\m_syst_string_one{#1}% \immediateassignment\edef\m_syst_string_two{#2}% \ifx\m_syst_string_one\m_syst_string_two - \expandafter\gobbleoneargument - \else \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument \fi} -\def\expandeddoifelse#1#2% +\def\expandeddoifnot#1#2% {\immediateassignment\edef\m_syst_string_one{#1}% \immediateassignment\edef\m_syst_string_two{#2}% \ifx\m_syst_string_one\m_syst_string_two - \expandafter\firstoftwoarguments + \expandafter\gobbleoneargument \else - \expandafter\secondoftwoarguments + \expandafter\firstofoneargument \fi} % \testfeatureonce{100000}{\doifelse{hello world}{here i am}{}} % 0.3 @@ -60,35 +60,24 @@ \def\expdoifcommonelse\expdoifelsecommon \def\expdoifinsetelse \expdoifelseinset -% we define these here, just in case ... +%D We define these here, just in case. This permits \typefile {self} otherwise +%D nested b|/|e sep problems. -\def\luastringsep{===} % this permits \typefile{self} otherwise nested b/e sep problems +\def\luastringsep{===} \edef\!!bs{[\luastringsep[} \edef\!!es{]\luastringsep]} \unexpanded\def\writestatus#1#2{\clf_writestatus{#1}{#2}} -% A handy helper: - -% \def\luaexpr#1{\ctxlua{context(tostring(#1))}} % more efficient: - -% We can omit the tex.ctxcatcodes here as nowadays we seldom -% change the regime at the \TEX\ end: +%D We can omit the tex.ctxcatcodes here as nowadays we seldom change the regime at +%D the \TEX\ end: +%def\luaexpr#1{\ctxlua{context (tostring(#1))}} % more efficient: \def\luaexpr#1{\ctxlua{tex.print(tostring(#1))}} % no use is shortcutting has to be compiled -% helpers: - -\def\ui_fo #1{#1} -\def\ui_go #1{} -\def\ui_ft#1#2{#1} -\def\ui_st#1#2{#2} - - -%D But as we only use write 16 we could as well do all in \LUA\ -%D and ignore the rest. Okay, we still can do writes here but only -%D when not blocked. +%D But as we only use write 16 we could as well do all in \LUA\ and ignore the rest. +%D Okay, we still can do writes here but only when not blocked. \let\syst_write_execute\clf_execute % always {...} -- cgit v1.2.3