Here I append code to \\ that looks ahead to see whether the \end in \end{tabular} is up next to bat. This code is hidden within a \noalign. The \\ has code that looks for a star and then a [ before finally calling the \cr. I suspect that herein lies the problem.
I am not sure whether this applies:
- Ignore spaces and \par's after an environment, because
\\is changed within tabular to fulfil the TeX\cr(end of row carriage return).
Code
See Log Output for \typeout{\noexpand\reserved@a value: \meaning\reserved@a}
\documentclass{article}
\usepackage{fontspec}
\usepackage{booktabs}
\catcode`@=11 % or \catcode"0040=11 or \makeatletter to change category code of @ to 11 and temporarily to access kernel macro \@tabularcr
\let\clone@tabularcr\@tabularcr%
\def\@tabularcr{\clone@tabularcr \mymidline}%
% Using \hline and \midrule as a model, I made my own hybrid with some extra end of tabular logic
\def\mymidline{%
\noalign{\ifnum0=`}\fi\@aboverulesep=\aboverulesep\global\@belowrulesep=\belowrulesep \futurelet
\reserved@a\@mymidline}%
\def\@mymidline{\typeout{\noexpand\reserved@a value: \meaning\reserved@a}\ifx\reserved@a\end\else% <-- Here is the value test. I need \reserved@a to eventually equal \end
\vskip\@aboverulesep%
\hrule \@height \lightrulewidth%
\vskip\@belowrulesep%
\fi
\ifnum0=`{\fi}}
\catcode`@=12 % or \catcode"0040=12 or \makeatother to restore category code of @ to 12
\begin{document}
\makeatletter
\begin{tabular}{ccc}
col1 & col2 & col3 \\
\meaning\@tabularcr & col2 & col3 \\
\meaning\\ & col2 & col3 \\
col1 & col2 & col3 \\
\meaning\clone@tabularcr & col2 & col3 \\
\end{tabular}
\makeatother
\end{document}


\end, not "blank space". – Jonathan Komar Nov 16 '16 at 15:37\@tabularcris the wrong macro to patch ifarraypackage is used (or colortbl, or tabularx or...) You could use\@ifnextcharinstead of\futureletas the main difference between them is that\@ifnextcharskips space but better would be to add your line after\\has tested and skipped the space, as adding it where you do you stops the[2pt]from working. – David Carlisle Nov 16 '16 at 15:47[2pt]. I was imitating\hlinecode while trying to hide\futureletin the\noalign– Jonathan Komar Nov 16 '16 at 15:56