From fc4466b32ed330a956ac603b00fd145524cff49a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 22 Apr 2016 22:14:39 +0000 Subject: context (22apr16) git-svn-id: svn://tug.org/texlive/trunk@40691 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/context/base/mkiv/syst-lua.mkiv | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv (limited to 'Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv') diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv new file mode 100644 index 00000000000..b5001ab6253 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv @@ -0,0 +1,63 @@ +%D \module +%D [ file=syst-lua, +%D version=2008.01.25, +%D title=\CONTEXT\ System Macros, +%D subtitle=Helper macros based on \LUA, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\registerctxluafile{syst-lua}{1.001} + +\unprotect + +\def\expdoifelse#1#2{\clf_doifelsesame{#1}{#2}} +\def\expdoif #1#2{\clf_doifsame {#1}{#2}} +\def\expdoifnot #1#2{\clf_doifnotsame {#1}{#2}} + +% \testfeatureonce{100000}{\doifelse{hello world}{here i am}{}} % 0.3 +% \testfeatureonce{100000}{\expandabledoifelse{hello world}{here i am}{}} % 1.5 + +\def\expdoifelsecommon#1#2{\clf_doifelsecommon{#1}{#2}} +\def\expdoifelseinset #1#2{\clf_doifelseinset {#1}{#2}} + +\def\expdoifcommonelse\expdoifelsecommon +\def\expdoifinsetelse \expdoifelseinset + +% we define these here, just in case ... + +\def\luastringsep{===} % this permits \typefile{self} otherwise nested b/e sep problems + +\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: + +\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. + +\let\syst_write_execute\clf_execute % always {...} + +\protect \endinput -- cgit v1.2.3