I don't get space-observing look-aheads right. What am I doing wrong here?
\documentclass{article}
\usepackage{expl3}
\begin{document}
\ExplSyntaxOn
\cs_new_protected:Npn \testInNormalLaTeXSyntax #1
{ \intern: #1 }
\cs_new_protected:Nn \intern:
{
\peek_charcode:NTF A
{ (next~token~is~A)~ }
{
\peek_charcode:NTF ~
{ (next~token~is~space)~ }
{ (next~token~is~neither~nor)~ }
}
}
\ExplSyntaxOff
Hello, world with spaces!\\
\testInNormalLaTeXSyntax{AA}\\
\testInNormalLaTeXSyntax{bA}\\
\testInNormalLaTeXSyntax{ A}
\end{document}
White the first test works (AA), but the code line \peek_charcode:NTF ~ breaks things.
\fooso the spaces is “gobbled”. May be you want\c_space_token? – Manuel Sep 13 '14 at 20:00