\def\cell:vbars{%
\def\:tempa##1##2{%
\tmp:cnt=0
\def\:temp####1{%
\if ####1##1\advance\tmp:cnt by 1 \fi
\if ####1.\else \expandafter\:temp \fi
}%
\expandafter\:temp\LR:VBars.%
\ifnum \tmp:cnt>0
\OOstyles{ fo:border-##2="<.hline resolution.>\the\tmp:cnt
cm solid \#000000" }%
\fi
}%
\:tempa L{left}%
\:tempa R{right}%
} -_-_-
\ifx \:AllColBars\empty
\let\LR:VBars=\empty
\else
\edef\LR:VBars{\Col:VBars}%
\fi
-_-_-
\AllColMargins Return a binary string in which 1 represents a column, and 0
represents a ‘@’. \ColMargins retrieves the zeros before the 1’s that represent the
current and following 1’s.
\def\Col:VBars{\expandafter\get:vbar\:AllColBars,,}
\def\get:vbar#1,{\if :#1:\else
\ifnum #1=0 \ifnum \HCol=1 L\fi
\else \ifnum \HCol=#1R\fi \fi
\expandafter\get:vbar \fi}
-_-_-
\let\AllColMargins\empty
\ConfigureEnv{array}
{\PushStack\Col:Marg\AllColMargins
\bgroup\Configure{$}{}{}{}}
{\egroup \PopStack\Col:Marg\AllColMargins}
{}{}
-_-_-
\ConfigureEnv{array}
{\PushStack\Col:Marg\AllColMargins
\bgroup\Configure{$}{}{}{}}
{\egroup \PopStack\Col:Marg\AllColMargins}
{}{}
-_-_-
\ConfigureEnv{tabular}
{\PushStack\Col:Marg\AllColMargins}
{\PopStack\Col:Marg\AllColMargins}
{}{}
-_-_-
\let\:AllColBars=\empty
-_-_-
\xdef\:AllColBars{\:AllColBars
\ifx\:AllColBars\empty \else ,\fi \ar:cnt}%
-_-_-
\PushStack\Col:Bars\:AllColBars
-_-_-
\PopStack\Col:Bars\:AllColBars
-_-_-