%%
%% This is file `array-xetex-bidi.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% bidi.dtx  (with options: `table,array-xetex-bidi.def')
%% 
%%   __________________________________________________
%%   Vafa Khalighi
%% 
%%   Copyright (c) 2007--2025  Vafa Khalighi
%%   Copyright (c) 2018--2020 bidi-tex GitHub Organization
%% 
%%   It may be distributed and/or modified under the LaTeX Project Public License,
%%   version 1.3c or higher (your choice). The latest version of
%%   this license is at: http://www.latex-project.org/lppl.txt
%% 
%%   This work is “author-maintained” (as per LPPL maintenance status)
%%   by Vafa Khalighi.
%% 
%% 
%% \CheckSum{57374}
%% \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
%%   Lower-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
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
\ProvidesFile{array-xetex-bidi.def}[2024/12/10 v0.5 bidi adaptations for array package for XeTeX engine]
\def\@testpach{\@chclass
 \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
  \ifnum \@lastchclass=7 5 \else
   \ifnum \@lastchclass=8 \tw@ \else
    \ifnum \@lastchclass=9 \thr@@
   \else \z@
   \ifnum \@lastchclass = 10 \else
   \edef\@nextchar{\expandafter\string\@nextchar}%
   \@chnum
   \if \@nextchar c\z@ \else
    \if \@nextchar \if@RTLtab r\else l\fi\@ne \else
     \if \@nextchar \if@RTLtab l\else r\fi\tw@ \else
   \z@ \@chclass
   \if\@nextchar |\@ne \else
    \if \@nextchar !6 \else
     \if \@nextchar @7 \else
      \if \@nextchar <8 \else
       \if \@nextchar >9 \else
  10
  \@chnum
  \if \@nextchar m\thr@@ \else
   \if \@nextchar p4 \else
    \if \@nextchar b5 \else
   \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
   \fi \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi}
\def\@tabular{%
  \leavevmode
  \hbox \bgroup\if@RTLtab\beginR \fi
  \UseTaggingSocket{tbl/hmode/begin}%
  $\col@sep\tabcolsep \let\d@llarbegin\begingroup
                                    \let\d@llarend\endgroup
  \@tabarray}
\def\endtabular{\endarray\m@th $
  \UseTaggingSocket{tbl/hmode/end}%
  \if@RTLtab\endR\fi\egroup
}
\expandafter\let\csname endtabular*\endcsname=\endtabular
\ExplSyntaxOn
\def\@array[#1]#2{
  \@tempdima \ht \strutbox
  \advance \@tempdima by\extrarowheight
  \setbox \@arstrutbox \hbox{\vrule
             \@height \arraystretch \@tempdima
             \@depth \arraystretch \dp \strutbox
             \@width \z@}%
  \tbl_save_outer_table_cols:
  \begingroup
  \@mkpream{#2}%
  \tbl_count_table_cols:
  \xdef\@preamble{
    \noexpand \ar@ialign
    \@halignto
       \bgroup \@arstrut
      \UseTaggingSocket{tbl/row/begin}
      \tbl_init_cell_data_for_row:
      \@preamble
      \tabskip \z@ \cr}
  \endgroup
  \@arrayleft
  \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi
  \bgroup
  \let \@sharp ##\let \protect \relax
  \lineskip \z@
  \baselineskip \z@
  \mathsurround \z@
  \let\\\@arraycr \let\tabularnewline\\\let\par\@empty
  \if@RTLtab\hbox\bgroup\beginR\@hboxRconstructtrue\if #1t\vtop \else \vbox  \fi\bgroup\fi
  \UseTaggingSocket{tbl/init}
  \@preamble
}
\ExplSyntaxOff
\let\@@array\@array
\ExplSyntaxOn
\def\endarray {
  \tbl_crcr:n{endarray} \egroup
  \UseTaggingSocket{tbl/finalize}
  \tbl_restore_outer_cell_data:
  \if@RTLtab\egroup\endR\egroup\fi
  \egroup
  \@arrayright \gdef\@preamble{}%
}
\ExplSyntaxOff
\def\array{\col@sep\arraycolsep
  \def\d@llarbegin{$}\let\d@llarend\d@llarbegin\def\@halignto{}%
  \@RTLtabfalse\@tabarray}
\endinput
%%
%% End of file `array-xetex-bidi.def'.
