%%
%% This is file `lwarp-listings.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lwarp.dtx  (with options: `listings')
%% This is a generated file.
%% Copyright 2016-2022 Brian Dunn
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% 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.


\LWR@ProvidesPackagePass{listings}[2018/09/02]

\lst@column@flexible
\let\LWR@origlst@Init\lst@Init
\let\LWR@origlst@DeInit\lst@DeInit

\let\LWR@origlsthkEveryPar\lsthk@EveryPar

\renewcommand{\l@lstlisting}[2]{\hypertocfloat{1}{lstlisting}{lol}{#1}{#2}}
\def\lstset@#1{\endgroup%
        \setkeys{lst}{%
            #1%
            ,literate=%
            {<}{\HTMLentity{lt}}{4}%
            {>}{\HTMLentity{gt}}{4}%
            {'}{\HTMLentity{apos}}{6}%
            {`}{\HTMLentity{grave}}{7}%
        }%
}
\renewcommand{\lst@Init}[1]{%
\LWR@traceinfo{lst@Init}%
\lst@ifdisplaystyle%        lwarp
    \LWR@forcenewpage%      lwarp
\fi%                        lwarp
\let\lst@ifmathescape\iffalse%      lwarp
\let\lst@DefEsc\relax%              lwarp
\def\lst@escapebegin{}%             lwarp
\def\lst@escapeend{}%               lwarp
\renewcommand*{\@captype}{lstlisting}%      lwarp
    \let\lst@aboveskip\z@\let\lst@belowskip\z@%     lwarp
    \gdef\lst@boxpos{t}%            lwarp
    \let\lst@frame\@empty%          lwarp
    \let\lst@frametshape\@empty%    lwarp
    \let\lst@framershape\@empty%    lwarp
    \let\lst@framebshape\@empty%    lwarp
    \let\lst@framelshape\@empty%    lwarp
    \lstframe@\lst@frameround ffff\relax%   lwarp
    \lst@multicols\@empty%  lwarp
    \begingroup%
            \hbadness=10000\relax%
    \ifx\lst@float\relax\else%
        \edef\@tempa{\noexpand\lst@beginfloat{lstlisting}[\lst@float]}%
        \expandafter\@tempa%
    \fi%
    \ifx\lst@multicols\@empty\else%
        \edef\lst@next{\noexpand\multicols{\lst@multicols}}%
        \expandafter\lst@next%
    \fi%
    \ifhmode\ifinner \lst@boxtrue \fi\fi%
    \lst@ifbox%
        \lsthk@BoxUnsafe%
        \hbox to\z@\bgroup%
             $\if t\lst@boxpos \vtop%
        \else \if b\lst@boxpos \vbox%
        \else \vcenter \fi\fi%
        \bgroup \par\noindent%
    \else%
        \lst@ifdisplaystyle%
            \lst@EveryDisplay%
            \par\penalty-50\relax%
            \vspace\lst@aboveskip%
        \fi%
    \fi%
    \normalbaselines%
    \abovecaptionskip\lst@abovecaption\relax%
    \belowcaptionskip\lst@belowcaption\relax%
    \lst@MakeCaption t%
\LWR@traceinfo{lst@Init: defining current label !\@currentlabel!}%
    \let\LWR@listings@currentlabel\@currentlabel%            lwarp
\LWR@traceinfo{lst@Init: defining current label !\cref@currentlabel!}%
    \let\LWR@listings@cref@currentlabel\cref@currentlabel%   lwarp
\LWR@traceinfo{lst@Init: preinit and init}%
    \lsthk@PreInit \lsthk@Init%
    \let\@currentlabel\LWR@listings@currentlabel%            lwarp
    \let\cref@currentlabel\LWR@listings@cref@currentlabel%   lwarp
\LWR@traceinfo{lst@Init: M}%
    \lst@ifdisplaystyle
        \global\let\lst@ltxlabel\@empty
        \if@inlabel
            \lst@ifresetmargins
                \leavevmode
            \else
                \xdef\lst@ltxlabel{\the\everypar}%
                \lst@AddTo\lst@ltxlabel{%
                    \global\let\lst@ltxlabel\@empty
                    \everypar{\lsthk@EveryLine\lsthk@EveryPar}}%
            \fi
        \fi
        \everypar\expandafter{\lst@ltxlabel
                              \lsthk@EveryLine\lsthk@EveryPar}%
    \else
        \everypar{}
        \let\lst@NewLine\@empty
    \fi
\LWR@traceinfo{lst@Init: P}%
    \lsthk@InitVars \lsthk@InitVarsBOL
    \lst@Let{13}\lst@MProcessListing
    \let\lst@Backslash#1%
    \lst@EnterMode{\lst@Pmode}{\lst@SelectCharTable}%
    \lst@InitFinalize%
\LWR@traceinfo{lst@Init: S}%
\def\lst@framelr{}%     lwarp
\LWR@traceinfo{lst@Init: finished origlst@Init}%
\lst@ifdisplaystyle%    lwarp
    \LWR@traceinfo{lst@Init: About to create verbatim.}%  lwarp
    \let\lsthk@EveryPar\relax%                  lwarp
    \LWR@atbeginverbatim{programlisting}%       lwarp

    \let\lsthk@EveryPar\LWR@origlsthkEveryPar%  lwarp
\else%                                          lwarp
    \ifbool{LWR@verbtags}{\LWR@htmltag{%        lwarp
        span class=\textquotedbl{}inlineprogramlisting\textquotedbl%    lwarp
    }}{}%                                       lwarp
\fi%                                            lwarp
\LWR@traceinfo{lst@Init: done}%
}
\renewcommand*{\lst@DeInit}{%
\LWR@traceinfo{lst@DeInit}%
\lst@ifdisplaystyle%
    \let\lsthk@EveryPar\relax%
    \LWR@afterendverbatim%
    \let\lsthk@EveryPar\LWR@origlsthkEveryPar%
\else%
    \ifbool{LWR@verbtags}{\noindent\LWR@htmltag{/span}}{}%
\fi%
    \lst@XPrintToken \lst@EOLUpdate
    \global\advance\lst@newlines\m@ne
    \lst@ifshowlines
        \lst@DoNewLines
    \else
        \setbox\@tempboxa\vbox{\lst@DoNewLines}%
    \fi
    \lst@ifdisplaystyle \par\removelastskip \fi
    \lsthk@ExitVars\everypar{}\lsthk@DeInit\normalbaselines\normalcolor
    \lst@MakeCaption b%
    \lst@ifbox
        \egroup $\hss \egroup
        \vrule\@width\lst@maxwidth\@height\z@\@depth\z@
    \else
        \lst@ifdisplaystyle
            \par\penalty-50\vspace\lst@belowskip
        \fi
    \fi
    \ifx\lst@multicols\@empty\else
        \def\lst@next{\global\let\@checkend\@gobble
                      \endmulticols
                      \global\let\@checkend\lst@@checkend}
        \expandafter\lst@next
    \fi
    \ifx\lst@float\relax\else
        \expandafter\lst@endfloat
    \fi
    \endgroup
\LWR@traceinfo{lst@DeInit done}%
}
\def\lst@MakeCaption#1{%
\LWR@traceinfo{lst@MakeCaption at #1}%
  \lst@ifdisplaystyle
\LWR@traceinfo{lst@MakeCaption: making a listings display caption}%
    \ifx #1t%
         \ifx\lst@@caption\@empty\expandafter\lst@HRefStepCounter \else
                                 \expandafter\refstepcounter
         \fi {lstlisting}%
        \let\lst@arg\lst@intname \lst@ReplaceIn\lst@arg\lst@filenamerpl
        \global\let\lst@name\lst@arg \global\let\lstname\lst@name
        \lst@ifnolol\else
            \ifx\lst@@caption\@empty
                \ifx\lst@caption\@empty
                    \ifx\lst@intname\@empty
                    \else
                        \def\lst@temp{ }%
                        \ifx\lst@intname\lst@temp \else
\LWR@traceinfo{lst@MakeCaption: addcontents lst@name: -\lst@name-}%
                        \fi
                    \fi
                \fi
            \else
\LWR@traceinfo{lst@MakeCaption: addcontents lst@@caption: -\lst@@caption-}%
                 \addcontentsline{lol}{lstlisting}%
{\protect\numberline{\thelstlisting}%
{\protect\ignorespaces \LWR@isolate{\lst@@caption} \protect\relax}}%
            \fi
         \fi
     \fi
    \ifx\lst@caption\@empty\else
\LWR@traceinfo{lst@MakeCaption: lst@caption not empty-}%
        \lst@IfSubstring #1\lst@captionpos
            {\begingroup
\LWR@traceinfo{lst@MakeCaption: at the selected position}%
             \ifx\lst@title\@empty
                    \LWR@stoppars%      lwarp
                  \lst@makecaption\fnum@lstlisting{\ignorespaces \lst@caption}
             \else
\LWR@traceinfo{lst@MakeCaption: Making title: \lst@title}%
\begin{BlockClass}{lstlistingtitle}%    lwarp
\lst@maketitle\lst@title%               lwarp
\end{BlockClass}%                       lwarp
             \fi%
\LWR@traceinfo{lst@MakeCaption: About to assign label: !\lst@label!}%
        \ifx\lst@label\@empty\else%
\leavevmode% gets rid of bad space factor error
\GetTitleStringExpand{\lst@caption}%
\edef\LWR@lntemp{\GetTitleStringResult}%
\edef\@currentlabelname{\detokenize\expandafter{\LWR@lntemp}}%
\label{\lst@label}\fi%
\LWR@traceinfo{lst@MakeCaption: Finished assigning the label.}%
             \endgroup}{}%
    \fi
\LWR@traceinfo{lst@MakeCaption: end of making a listings display caption}%
  \else
\LWR@traceinfo{lst@MakeCaption: INLINE}%
  \fi
\LWR@traceinfo{lst@MakeCaption: done at #1}%
}

\renewcommand{\lst@maketitle}[1]{%
    \LWR@isolate{#1}%
}%

\lst@Key{numbers}{none}{%
    \let\lst@PlaceNumber\@empty
    \lstKV@SwitchCases{#1}%
    {none:\\%
     left:\def\lst@PlaceNumber{%
            \LWR@orignormalfont%
            \lst@numberstyle{\thelstnumber}\kern\lst@numbersep%
    }\\%
     right:\def\lst@PlaceNumber{\LWR@origrlap{\LWR@orignormalfont
                \kern 6in \kern\lst@numbersep
                \lst@numberstyle{\thelstnumber}}}%
    }{\PackageError{lwarp-listings}{Numbers #1 unknown}\@ehc}}

\endinput
%%
%% End of file `lwarp-listings.sty'.
