From f871c8d0f3f5aeba9375c273294327a6d40f64c1 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sat, 23 Mar 2019 11:38:09 +0100
Subject: replaced \NewEnviron with LaTeX3 equivalent

---
 arabluatex.dtx | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

(limited to 'arabluatex.dtx')

diff --git a/arabluatex.dtx b/arabluatex.dtx
index 4f185ce..7eb5ce7 100644
--- a/arabluatex.dtx
+++ b/arabluatex.dtx
@@ -263,7 +263,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{931}
+% \CheckSum{0}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -4696,33 +4696,33 @@ wa-ya.sIru ta.hta 'l-jild-i
 % The |arab| environment does for paragraphs the same as \cs{arb} does
 % for short insertions of Arabic text.
 %    \begin{macrocode}
-\NewEnviron{arab}[1][\al@mode]%
+\NewDocumentEnvironment{arab}{O{\al@mode} +b}%
 {\par\edef\@tempa{#1}%
   \ifx\@tempa\al@mode@voc%
   \booltrue{al@rlmode}%
   \bgroup\pardir TRT\textdir TRT\arabicfont%
-  \luadirect{tex.sprint(arabluatex.processvoc(\luastringO{\BODY},
+  \luadirect{tex.sprint(arabluatex.processvoc(\luastringN{#2},
     \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
   \else%
   \ifx\@tempa\al@mode@fullvoc%
   \booltrue{al@rlmode}%
   \bgroup\pardir TRT\textdir TRT\arabicfont%
-  \luadirect{tex.sprint(arabluatex.processfullvoc(\luastringO{\BODY},
+  \luadirect{tex.sprint(arabluatex.processfullvoc(\luastringN{#2},
     \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
   \else%
   \ifx\@tempa\al@mode@novoc%
   \booltrue{al@rlmode}%
   \bgroup\pardir TRT\textdir TRT\arabicfont%
-  \luadirect{tex.sprint(arabluatex.processnovoc(\luastringO{\BODY},
+  \luadirect{tex.sprint(arabluatex.processnovoc(\luastringN{#2},
     \luastringO{\al@arb@rules}, \luastringO{\al@input@scheme}))}\egroup%
   \else%
   \ifx\@tempa\al@mode@trans%
   \bgroup\pardir TLT\textdir TLT\al@trans@font\al@trans@style%
-  \luadirect{tex.sprint(arabluatex.processtrans(\luastringO{\BODY},
+  \luadirect{tex.sprint(arabluatex.processtrans(\luastringN{#2},
     \luastringO{\al@trans@convention},
     \luastringO{\al@arb@rules},
     \luastringO{\al@input@scheme}))}\egroup%
-  \else \fi\fi\fi\fi}[\par]
+  \else \fi\fi\fi\fi}{\par}
 %    \end{macrocode}
 % \end{environment}
 % \begin{environment}{arabverse}
@@ -4775,7 +4775,7 @@ wa-ya.sIru ta.hta 'l-jild-i
     \else%
     \ifx\al@mode\al@mode@trans\setLR\else\setRL\fi%
     \fi%
-  \arab@v@export{#1}
+  \arab@v@export[#1]
   }%
   {\endarab@v@export
     \hfill\setkeys[al]{verse}[width, gutter, color, utf, delim, mode,
@@ -4975,32 +4975,32 @@ wa-ya.sIru ta.hta 'l-jild-i
 %   selected |.tex| file with Unicode in place of the original
 %   |arabtex| or |buckwalter| strings.
 %    \begin{macrocode}
-\NewEnviron{arabexport}{%
+\NewDocumentEnvironment{arabexport}{+b}{%
   \if@pkg@export%
   \par
-  \BODY
+  #1
   \luadirect{arabluatex.doexport("yes")}
-  \luadirect{tex.sprint(arabluatex.arbtoutf(\luastringO{\BODY}))}
+  \luadirect{tex.sprint(arabluatex.arbtoutf(\luastringN{#1}))}
   \luadirect{arabluatex.doexport("no")}
-  \else\par\BODY\fi
-  }[\par]
+  \else\par#1\fi
+  }{\par}
 %    \end{macrocode}
 % \end{environment}
 % \begin{environment}{arab@v@export} The |arab@v@export| environment
 %   does for |arabverse| the same as |arabexport|. It is used
 %   internally by |arabverse|.
 %    \begin{macrocode}
-\NewEnviron{arab@v@export}[1]{%
+\NewDocumentEnvironment{arab@v@export}{O{} +b}{%
   \setkeys[al]{verse}[width, gutter, color, utf, delim, mode,
   metre]{#1}
   \if@pkg@export\ifal@verse@export%
   \par
-  \BODY
+  #2
   \luadirect{arabluatex.doexport("arabverse")}
-  \luadirect{tex.sprint(arabluatex.arbtoutf(\luastringO{\BODY}))}
+  \luadirect{tex.sprint(arabluatex.arbtoutf(\luastringN{#2}))}
   \luadirect{arabluatex.doexport("no")}
-  \else\par\BODY\fi\else\par\BODY\fi
-}[\par]
+  \else\par#2\fi\else\par#2\fi
+}{\par}
 %    \end{macrocode}
 % \end{environment}
 % \begin{macro}{\arbpardir}
-- 
cgit v1.2.3

