%%
%% This is file `xpunctuate.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xpunctuate.dtx  (with options: `package')
%% 
%% Copyright (C) 2023 Philip G. Ratcliffe <philip.ratcliffe@uninsubria.it>
%% 
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version.  The latest version
%% of this license is in the file
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% This file is part of the "xpunctuate package" (the Work in LPPL)
%% and all files in that package must be distributed together.
%% 
%% The released version of this package is available from CTAN.
%% 
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\ProvidesPackage{xpunctuate}
  [2023/08/13 v2.0 punctuation after command names (PGR)]
\RequirePackage{xspace}
\xspaceaddexceptions{\xcomma\xperiod\xperiodcomma}
\NewDocumentCommand\xspaceafter{}{\xpnct@aux\xspace@aux}
\NewDocumentCommand\xperiod{}{\xpnct@aux\xperiod@aux{}}
\NewDocumentCommand\xperiodafter{}{\xpnct@aux\xperiod@aux}
\NewDocumentCommand\xcomma{}{\xpnct@aux\xcomma@aux{}}
\NewDocumentCommand\xcommaafter{}{\xpnct@aux\xcomma@aux}
\NewDocumentCommand\xperiodcomma{}{\xpnct@aux\xperiodcomma@aux{}}
\NewDocumentCommand\xperiodcommaafter{}{\xpnct@aux\xperiodcomma@aux}
\newtoks\xpnct@tok
\def\xpnct@aux#1#2{%
  \xpnct@tok{#2}%
  \futurelet\xpnct@nxt#1}
\def\xspace@aux{%
  \ifx\xpnct@nxt,\else
  \ifx\xpnct@nxt.\else
    \xpnct@tok\expandafter{\the\xpnct@tok\xspace}%
  \fi\fi
  \the\xpnct@tok}
\def\xperiod@aux{%
  \ifx\xpnct@nxt.\else
    \xpnct@tok\expandafter{\the\xpnct@tok.\@\xspace}%
  \fi
  \the\xpnct@tok}
\def\xcomma@aux{%
  \ifx\xpnct@nxt.\else
  \ifx\xpnct@nxt,\else
  \ifx\xpnct@nxt:\else
  \ifx\xpnct@nxt;\else
  \ifx\xpnct@nxt!\else
  \ifx\xpnct@nxt?\else
  \ifx\xpnct@nxt/\else
  \ifx\xpnct@nxt-\else
  \ifx\xpnct@nxt'\else
  \ifx\xpnct@nxt)\else
  \ifx\xpnct@nxt]\else
  \ifx\xpnct@nxt\}\else
  \ifx\xpnct@nxt\egroup\else
  \ifx\xpnct@nxt\/\else
    \xpnct@tok\expandafter{\the\xpnct@tok,\xspace}%
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  \the\xpnct@tok}
\def\xperiodcomma@aux{%
  \ifx\xpnct@nxt.\else
    \xpnct@tok\expandafter{\the\xpnct@tok.\@\xcomma}%
  \fi
  \the\xpnct@tok}
\endinput
%%
%% End of file `xpunctuate.sty'.
