What is the problem with the following minimal example:
\documentclass{article}
\usepackage{color}
\makeatletter
\newcount\n
\n=`\a \loop \XeTeXcharclass \n=4 \ifnum\n<`\z \advance\n by 1 \repeat
\XeTeXinterchartoks 0 4 {\startcolor}
\XeTeXinterchartoks 255 4 {\startcolor}
\XeTeXinterchartoks 255 0 {\finishcolor}
\XeTeXinterchartoks 4 0 {\finishcolor}
\newif\ifcolor
\newcommand{\startcolor}{\ifcolor\else\bgroup\color{red}\colortrue\fi}
\newcommand{\finishcolor}{\ifcolor\egroup\fi}
\makeatother
\XeTeXinterchartokenstate=1
\begin{document}
this is a test
\end{document}
It produces the following error:
! Missing } inserted.
<inserted text>
}
l.19 \end{document}
?
However if "this is a test" is replaced with "this is a test.", then I get
no error. How should I fix this?
--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
http://tug.org/mailman/listinfo/xetex