%%
%% This is file `ltxcmds-test-nextchar.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% ltxcmds.dtx  (with options: `test-nextchar')
%% 
%% This is a generated file.
%% 
%% Project: ltxcmds
%% Version: 2011/11/09 v1.22
%% 
%% Copyright (C) 2009-2011 by
%%    Heiko Oberdiek <heiko.oberdiek at googlemail.com>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
%%    http://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% This Current Maintainer of this work is Heiko Oberdiek.
%% 
%% The Base Interpreter refers to any `TeX-Format',
%% because some files are installed in TDS:tex/generic//.
%% 
%% This work consists of the main source file ltxcmds.dtx
%% and the derived files
%%    ltxcmds.sty, ltxcmds.pdf, ltxcmds.ins, ltxcmds.drv,
%%    ltxcmds-test1.tex, ltxcmds-test-gobble.tex,
%%    ltxcmds-test-ifempty.tex, ltxcmds-test-zapspace.tex,
%%    ltxcmds-test-ifboxempty.tex, ltxcmds-test-nextchar.tex,
%%    ltxcmds-test-carcdr.tex.
%% 
\catcode`\{=1 %
\catcode`\}=2 %
\catcode`\#=6 %
\catcode`\@=11 %
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname RequirePackage\endcsname\relax
  \input ltxcmds.sty\relax
  \input eolgrab.sty\relax
\else
  \RequirePackage{ltxcmds}[2011/11/09]%
  \RequirePackage{eolgrab}[2011/01/12]%
\fi
\def\msg#{\immediate\write16}
\begingroup
  \def\x#1{%
    \endgroup
    \let\TestSpaceToken= #1\relax
  }%
\x{ }
\def\TestSpace{ }
\begingroup
  \lccode32=65 % space -> A
\lowercase{%
  \endgroup
  \def\TestSpaceA{ }%
}
\def\TestCatch{%
  \eolgrab\@TestCatch
}
\def\@TestCatch#1{%
  \begingroup
    \def\x{#1}%
    \ifx\x\ltx@empty
    \else
      \ltx@onelevel@sanitize\x
      \errmessage{Unparsed stuff on line [\x]}%
    \fi
  \endgroup
}
\def\TestCmdM#1{%
  \TestCheckType{M}%
  \TestCatch
}
\def\TestCmdOM[#1]#2{%
  \TestCheckType{O}%
  \TestCatch
}
\def\TestCheckType#1{%
  \if\TestCmdType#1\relax
  \else
    \errmessage{Wrong type #1, expected: \TestCmdType}%
  \fi
}
\def\TestCmd#1{%
  \def\TestCmdType{#1}%
  \ltx@ifnextchar[\TestCmdOM\TestCmdM
}
\def\TestCmdExp#1{%
  \expandafter\TestCmd\expandafter#1%
}
\outer\def\TestOuter{}
\TestCmd O[o]{m}
\TestCmd M{m}
\TestCmd O [o]{m}
\TestCmd M {m}
\def\x#1{\def\x{#1#1}}\x{ }
\TestCmdExp O\x[o]{m}
\TestCmdExp M\x{m}
\def\x#1{\def\x{#1#1#1#1}}\x{ }
\TestCmdExp O\x[o]{m}
\TestCmdExp M\x{m}
\def\x{\TestSpaceToken}
\TestCmdExp O\x[o]{m}
\TestCmdExp M\x{m}
\def\x{\TestSpaceToken\TestSpaceToken\TestSpaceToken}
\TestCmdExp O\x[o]{m}
\TestCmdExp M\x{m}
\TestCmd M\TestSpace
\TestOuter
\TestCmd M \TestSpace
\TestOuter
\TestCmd M\iftrue
\TestOuter
\TestCmd M\iffalse
\TestOuter
\TestCmd M\else
\TestOuter
\TestCmd M\fi
\TestOuter
\TestCmd M \iftrue
\TestOuter
\TestCmd M \iffalse
\TestOuter
\TestCmd M \else
\TestOuter
\def\TestCmd#1{%
  \def\TestCmdType{#1}%
  \ltx@ifnextchar@nospace[\TestCmdOM\TestCmdM
}
\TestCmd O[o]{m}
\TestCmd M{m}
\TestCmd M [
\TestOuter
\TestCmd M {m}
\TestCmd M\iftrue
\TestOuter
\TestCmd M\iffalse
\TestOuter
\TestCmd M\else
\TestCmd M\fi
\TestOuter
\TestOuter
\def\TestCmd#1{%
  \def\TestCmdType{#1}%
  \ltx@ifnextchar(\TestCmdPM\TestCmdM
}
\def\TestCmdPM(#1)#2{%
  \TestCheckType{P}%
  \TestCatch
}
\TestCmd P(p){m}
\TestCmd M{m}
\TestCmd P (p){m}
\TestCmd M {m}
\def\TestCmd#1{%
  \def\TestCmdType{#1}%
  \ltx@ifnextchar{ }\TestCmdSM\TestCmdM
}
\def\TestCmdSM#1#{%
  \TestCheckType{S}%
  \begingroup
    \let\x= #1\relax
    \ifx\x\TestSpaceToken
    \else
      \errmessage{unexpected space token: \meaning#1}%
    \fi
  \endgroup
  \def\TestCmdType{M}%
  \TestCmdM
}
\TestCmd S {m}
\TestCmd M{m}
\def\x#1{\def\x{#1#1}}\x{ }
\TestCmdExp S\x{m}
\def\TestCmd#1{%
  \def\TestCmdType{#1}%
  \ltx@ifnextchar\iffalse\TestCmdIM\TestCmdM
}
\def\TestCmdIM\iffalse#1{%
  \TestCheckType{I}%
  \TestCatch
}
\TestCmd M\iftrue
\TestOuter
\TestCmd M \iftrue
\TestCmd I\iffalse\iffalse
\TestCmd I \iffalse\iffalse
\TestOuter
\def\TestCmd#1{%
  \def\TestCmdType{#1}%
  \ltx@ifnextchar@nospace\iffalse\TestCmdIM\TestCmdM
}
\TestCmd M\iftrue
\TestOuter
\TestCmd I\iffalse\iffalse
\TestOuter
\csname @@end\endcsname\end
\endinput
%%
%% End of file `ltxcmds-test-nextchar.tex'.
