diff options
author | ax006ho <j.hoffmann@fh-aachen.de> | 2019-02-17 20:39:51 +0100 |
---|---|---|
committer | ax006ho <j.hoffmann@fh-aachen.de> | 2019-02-17 20:39:51 +0100 |
commit | 7bf4ed0ae5d70eb4e80e460e37da1df6facc3523 (patch) | |
tree | 43b2d858e198f2dd74d4bb5aefe23fae9fa756d0 | |
parent | 0b2ececa870ac30b6cb4c506476be944e99fe6f8 (diff) | |
parent | 391da7ef5d1180c2707734755ae5c10760a1cf7a (diff) | |
download | listings-7bf4ed0ae5d70eb4e80e460e37da1df6facc3523.tar.gz listings-7bf4ed0ae5d70eb4e80e460e37da1df6facc3523.tar.bz2 |
Merge branch 'master' of ssh://git.gnu.org.ua/listings
42 files changed, 5554 insertions, 38 deletions
@@ -1,6 +1,8 @@ ## files to be ignored given by name lstdrvrs.ins temp.c +testing/keyval/extendedchars/iso_8859_1.out +testing/keyval/extendedchars/iso_8859_1.txt ## directories to be ignored by name (there must be a trailing /) auto/ diff --git a/testing/Makefile b/testing/Makefile index 28d5d71..5a3264a 100644 --- a/testing/Makefile +++ b/testing/Makefile @@ -21,12 +21,61 @@ testing: echo "testing" -all: acm algol bash c++11 cobol fortran gap lua python scala vbscript \ - braces \ - numbering \ - ext_error \ - tilde_error \ - v_space_error +all: ext_error fonts frame minus_error paragraph \ # error cases + swapped_characters_error tilde_error v_space_error \ + braces \ # experimental features + break columns extendedchars numbering spaces \ # keyval + acm algol bash c++11 cobol command.com \ # languages + elisp fortran gap go hansl-gretl java \ + llvm lua mathematica python rexx scala swift vbscript xml \ + + +# testing several error cases +ext_error: + cd ./errors/ext_error; make all + +fonts: + cd ./errors/fonts; make all + +frame: + cd ./errors/frame; make all + +minus_error: + cd ./errors/minus_error; make all + +paragraph: + cd ./errors/paragraph; make all + +tilde_error: + cd ./errors/tilde_error; make all + +v_space_error: + cd ./errors/v_space_error; make all + +swapped_characters_error: + cd ./errors/swapped_characters_error; make all + + +# testing the experimental features +braces: + cd ./experimental_features/braces; make all + + +# testing several keyval values +break: + cd ./keyval/break; make all + +columns: + cd ./keyval/columns; make all + +extendedchars: + cd ./keyval/extendedchars; make all + +numbering: + cd ./keyval/numbering; make all + +spaces: + cd ./keyval/spaces; make all # testing the different languages @@ -92,21 +141,3 @@ vbscript: xml: cd ./languages/xml; make all - -# testing the experimental features -braces: - cd ./experimental_features/braces; make all - -# testing several keyval values -numbering: - cd ./keyval/numbering; make all - -# testing several error cases -ext_error: - cd ./errors/ext_error; make all - -tilde_error: - cd ./errors/tilde_error; make all - -v_space_error: - cd ./errors/v_space_error; make all diff --git a/testing/errors/paragraph/README.md b/testing/errors/paragraph/README.md new file mode 100644 index 0000000..83f44a5 --- /dev/null +++ b/testing/errors/paragraph/README.md @@ -0,0 +1 @@ +# Testing the behaviour of the \paragraph command before a listing environment # diff --git a/testing/errors/paragraph/paragraph_04.tex b/testing/errors/paragraph/paragraph_04.tex new file mode 100644 index 0000000..9bcc806 --- /dev/null +++ b/testing/errors/paragraph/paragraph_04.tex @@ -0,0 +1,72 @@ +\documentclass{article} + +\pagestyle{empty} +\setcounter{page}{6} +\setlength\textwidth{207.0pt} + + +\usepackage{listings} +\lstset{language=fortran} + +\usepackage[T1]{fontenc} + +\begin{document} + +\section{This Is A Section } +\label{sec:this-section} + +\subsection{This Is A Subsection} +\label{sec:this-subsection} + +\subsubsection{This Is A Subsubsection} +\label{sec:this-subsubsection} + +\paragraph{This Is A Paragraph} +\label{sec:this-paragraph} + +\begin{lstlisting} +s = "This string gets assigned in a paragraph" +\end{lstlisting} + + +\section{This Is Another Section} +\label{sec:this-section} + +\subsection{This Is Another Subsection} +\label{sec:this-subsection} + +\subsubsection{This Is Another Subsubsection} +\label{sec:this-subsubsection} + +\paragraph{This Is Another Paragraph} +\label{sec:this-paragraph} + +\leavevmode + +\begin{lstlisting} +s = "This string gets assigned in a paragraph" +\end{lstlisting} + + +\section{This Is One More Section} +\label{sec:this-section} + +\subsection{This Is One More Subsection} +\label{sec:this-subsection} + +\subsubsection{This Is One More Subsubsection} +\label{sec:this-subsubsection} + +\paragraph{This Is One More Paragraph} +\label{sec:this-paragraph} + +\makeatletter % this doesn't help anymore +\let\if@nobreak\iffalse +\makeatother + +\begin{lstlisting} +s = "This string gets assigned in a paragraph" +\end{lstlisting} + + +\end{document} diff --git a/testing/experimental_features/Makefile.common b/testing/experimental_features/Makefile.common new file mode 100644 index 0000000..f177c7d --- /dev/null +++ b/testing/experimental_features/Makefile.common @@ -0,0 +1,57 @@ +### Makefile.common --- +# +# This file defines common settings for all test cases +# +# $Id: Makefile.common 69 2013-08-04 10:23:30Z j_hoffmann $ +# +# (c) 2013 Jobst Hoffmann +# +# This file is distributed under the terms of the LaTeX Project Public +# License from CTAN archives in directory macros/latex/base/lppl.txt. +# Either version 1.3 or, at your option, any later version. + +# remember: +# $<: first element of list of dependees +# $^: list of (all) dependees +# $@: target + +LATEX = pdflatex +TEXINPUTS := .:../../../:`kpsewhich -var-value=TEXINPUTS` + +VPATH = .:../../../ + +## Clean targets +clean: + -rm -f *~ *.aux *.lof *.log *.lot *.tmp *.toc + -rm -f *.idx *.ind *.glg *.glo *.gls *.ilg *.out + -rm -f *.bbl *.blg *.brf + +clean-results: + -rm -f *.pdf *.sty + +realclean: clean clean-results + +## Documentation target +help:: + $(info ) + $(info make [all] executes all tests in the current directory) + $(info ) + $(info make <file name>) + $(info $(empty) executes the test case given by <file name>) + $(info ) + $(info make help shows this help) + $(info ) + $(info make clean removes all intermediate files created by a LaTeX run) + $(info ) + $(info make clean-results) + $(info $(empty) removes .cfg, .sty, and .pdf files) + $(info ) + $(info make realclean) + $(info $(empty) performs clean and clean-results) + $(info ) + @echo "" # prevents message "nothing to do ..." + +%.pdf: %.tex + TEXINPUTS=${TEXINPUTS} $(LATEX) $(<) + +### Makefile.common ends here --- diff --git a/testing/experimental_features/braces/Makefile b/testing/experimental_features/braces/Makefile new file mode 100644 index 0000000..3ca0015 --- /dev/null +++ b/testing/experimental_features/braces/Makefile @@ -0,0 +1,38 @@ +### Makefile --- +# +# This file executes Fortran test files for the listings package. +# +# $Id: Makefile 114 2013-10-25 08:56:27Z j_hoffmann $ +# +# (c) 2013 Jobst Hoffmann +# +# This file is distributed under the terms of the LaTeX Project Public +# License from CTAN archives in directory macros/latex/base/lppl.txt. +# Either version 1.3 or, at your option, any later version. + +# remember: +# $<: first element of list of dependees +# $^: list of (all) dependees +# $@: target + +SOURCES = \ + align.tex \ + preinig_00.tex \ + preinig_01.tex \ + +.PHONY: all echo + +.SUFFIXES: .pdf .tex + +all: ${SOURCES:.tex=.pdf} + + +################## +## common settings + +ifneq "$(wildcard ../Makefile.common)" "" +include ../Makefile.common # the list of the local targets + # generated by hand +endif + +### Makefile ends here --- diff --git a/testing/experimental_features/braces/align.tex b/testing/experimental_features/braces/align.tex new file mode 100644 index 0000000..9f7237d --- /dev/null +++ b/testing/experimental_features/braces/align.tex @@ -0,0 +1,93 @@ +%%% align.tex --- +% +%% Author: j.hoffmann@fh-aachen.de +%% Version: $Id: align.tex 0 2014/01/25 12:22:31 ax006ho Exp $ + +\RequirePackage{ifpdf} +\RequirePackage{ifluatex} + +% \documentclass[12pt,a4paper,english,ngerman]{article} + +\documentclass[12pt,a4paper,english,ngerman]{scrartcl} + % bei gemischtsprachigem Satz ist die + % zuletzt geladene Sprache aktiv +\usepackage{etex} % es werden e-TeX Makros aktiviert + % und die Zaehlergrenzen hoch gesetzt +% \usepackage{typearea} % ein auf DIN A4 abgestimmtes Seitenformat, + % wird nur bei article gebraucht + +\ifluatex % wenn mit dem neuen TeX-Prozessor + % gearbeitet wird + \usepackage{luatex} % Unterstützung der Lua-Programmierung + % luatex unterstützt utf-8, also keine + %---- Eingabezeichensatz --------------------------------------------------- + % Festlegung des Eingabezeichensatzes + % erforderlich + %---- Grundfont ------------------------------------------------------------ + \usepackage{fontspec} % Festlegen der Fontverwaltung für LuaTeX. + \defaultfontfeatures{Ligatures=TeX} + \fontspec{Latin Modern Roman} +\else + %---- Eingabezeichensatz --------------------------------------------------- + \usepackage[utf8]{inputenc} % Eingabe deutscher Umlaute + % Unix/Linux: utf8 + % Unix/Linux: latin1 (alt) + % Windows: cp1250 + + %---- Grundfont ------------------------------------------------------------ + \usepackage[T1]{fontenc} % ec-Fonts + \usepackage{lmodern} % wg. der lm-Fonts (keine bitmap-Fonts!) +\fi + +%---- Bezuege ---------------------------------------------------------------- +\usepackage[german]{fancyref} % deutschsprachige Bezuege, vor babel zu + % laden + +%---- Sprachauswahl ---------------------------------------------------------- +\usepackage{babel} % fuer gemischtsprachigen Einsatz +\ifluatex\else + \usepackage{babelbib} % fuer eine dazu passende Bibliographie, + % luatex kennt seine eigene + % Bibliographieverwaltung +\fi + +%---- Sonstiges -------------------------------------------------------------- +% \PassOptionsToPackage{debugshow,final}{graphicx} % bei Bedarf zu aktivieren +\usepackage{graphicx} % Vorbereitung der Graphiken + +\usepackage{url} +\let\email\url +\usepackage{listings} + +% \makeatletter +% \let\oldInlineG\lst@InlineG +% \def\lst@InlineG{\ifnum`{=0}\fi \oldInlineG} +% \makeatother + +\begin{document} + +\email{Luc.VanEycken@esat.kuleuven.be} provided this example. + +\begin{tabular}{ll} + \lstinline{x} & x \\ +\end{tabular} + +\begin{enumerate} + \item \lstinline{x} \(\rightarrow\) x +\end{enumerate} + +\lstinline{x} \(\rightarrow\) x + +\section{\lstinline{x} \(\rightarrow\) x} +\label{sec:lstinl-right-x} + + +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% TeX-source-correlate-mode: t +%%% mode: flyspell +%%% ispell-local-dictionary: "english" +%%% End: diff --git a/testing/experimental_features/braces/listings-1.5b.sty b/testing/experimental_features/braces/listings-1.5b.sty new file mode 100644 index 0000000..5de1edb --- /dev/null +++ b/testing/experimental_features/braces/listings-1.5b.sty @@ -0,0 +1,2245 @@ +%% +%% This is file `listings.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% listings.dtx (with options: `kernel') +%% +%% Please read the software license in listings-1.3.dtx or listings-1.3.pdf. +%% +%% (w)(c) 1996--2004 Carsten Heinz and/or any other author listed +%% elsewhere in this file. +%% (c) 2006 Brooks Moses +%% (c) 2013- Jobst Hoffmann +%% +%% Send comments and ideas on the package, error reports and additional +%% programming languages to Jobst Hoffmann at <j.hoffmann@fh-aachen.de>. +%% +\def\filedate{2013/08/26} +\def\fileversion{1.5b} +\NeedsTeXFormat{LaTeX2e} +\AtEndOfPackage{\ProvidesPackage{listings} + [\filedate\space\fileversion\space(Carsten Heinz)]} +\def\lst@CheckVersion#1{\edef\reserved@a{#1}% + \ifx\lst@version\reserved@a \expandafter\@gobble + \else \expandafter\@firstofone \fi} +\let\lst@version\fileversion +\def\lst@InputCatcodes{% + \makeatletter \catcode`\"12% + \catcode`\^^@\active + \catcode`\^^I9% + \catcode`\^^L9% + \catcode`\^^M9% + \catcode`\%14% + \catcode`\~\active} +\def\lst@RestoreCatcodes#1{% + \ifx\relax#1\else + \noexpand\catcode`\noexpand#1\the\catcode`#1\relax + \expandafter\lst@RestoreCatcodes + \fi} +\edef\lst@RestoreCatcodes{% + \noexpand\lccode`\noexpand\/`\noexpand\/% + \lst@RestoreCatcodes\"\^^I\^^M\~\^^@\relax + \catcode12\active} +\lst@InputCatcodes +\AtEndOfPackage{\lst@RestoreCatcodes} +\def\@lst{lst} +\def\lst@IfSubstring#1#2{% + \def\lst@temp##1#1##2##3\relax{% + \ifx \@empty##2\expandafter\@secondoftwo + \else \expandafter\@firstoftwo \fi}% + \expandafter\lst@temp#2#1\@empty\relax} +\def\lst@IfOneOf#1\relax#2{% + \def\lst@temp##1,#1,##2##3\relax{% + \ifx \@empty##2\expandafter\@secondoftwo + \else \expandafter\@firstoftwo \fi}% + \expandafter\lst@temp\expandafter,#2,#1,\@empty\relax} +\def\lst@DeleteKeysIn#1#2{% + \expandafter\lst@DeleteKeysIn@\expandafter#1#2,\relax,} +\def\lst@DeleteKeysIn@#1#2,{% + \ifx\relax#2\@empty + \expandafter\@firstoftwo\expandafter\lst@RemoveCommas + \else + \ifx\@empty#2\@empty\else + \def\lst@temp##1,#2,##2{% + ##1% + \ifx\@empty##2\@empty\else + \expandafter\lst@temp\expandafter,% + \fi ##2}% + \edef#1{\expandafter\lst@temp\expandafter,#1,#2,\@empty}% + \fi + \fi + \lst@DeleteKeysIn@#1} +\def\lst@RemoveCommas#1{\edef#1{\expandafter\lst@RC@#1\@empty}} +\def\lst@RC@#1{\ifx,#1\expandafter\lst@RC@ \else #1\fi} +\def\lst@ReplaceIn#1#2{% + \expandafter\lst@ReplaceIn@\expandafter#1#2\@empty\@empty} +\def\lst@ReplaceInArg#1#2{\lst@ReplaceIn@#1#2\@empty\@empty} +\def\lst@ReplaceIn@#1#2#3{% + \ifx\@empty#3\relax\else + \def\lst@temp##1#2##2{% + \ifx\@empty##2% + \lst@lAddTo#1{##1}% + \else + \lst@lAddTo#1{##1#3}\expandafter\lst@temp + \fi ##2}% + \let\@tempa#1\let#1\@empty + \expandafter\lst@temp\@tempa#2\@empty + \expandafter\lst@ReplaceIn@\expandafter#1% + \fi} +\providecommand*\@gobblethree[3]{} +\def\lst@GobbleNil#1\@nil{} +\def\lst@Swap#1#2{#2#1} +\def\lst@true{\let\lst@if\iftrue} +\def\lst@false{\let\lst@if\iffalse} +\lst@false +\def\lst@IfNextCharsArg#1{% + \def\lst@tofind{#1}\lst@IfNextChars\lst@tofind} +\def\lst@IfNextChars#1#2#3{% + \let\lst@tofind#1\def\@tempa{#2}\def\@tempb{#3}% + \let\lst@eaten\@empty \lst@IfNextChars@} +\def\lst@IfNextChars@{\expandafter\lst@IfNextChars@@\lst@tofind\relax} +\def\lst@IfNextChars@@#1#2\relax#3{% + \def\lst@tofind{#2}\lst@lAddTo\lst@eaten{#3}% + \ifx#1#3% + \ifx\lst@tofind\@empty + \let\lst@next\@tempa + \else + \let\lst@next\lst@IfNextChars@ + \fi + \expandafter\lst@next + \else + \expandafter\@tempb + \fi} +\def\lst@IfNextCharActive#1#2#3{% + \begingroup \lccode`\~=`#3\lowercase{\endgroup + \ifx~}#3% + \def\lst@next{#1}% + \else + \def\lst@next{#2}% + \fi \lst@next #3} +\def\lst@for#1\do#2{% + \def\lst@forbody##1{#2}% + \def\@tempa{#1}% + \ifx\@tempa\@empty\else\expandafter\lst@f@r#1,\@nil,\fi +} +\def\lst@f@r#1,{% + \def\@tempa{#1}% + \ifx\@tempa\@nnil\else\lst@forbody{#1}\expandafter\lst@f@r\fi +} +\def\lst@MakeActive#1{% + \let\lst@temp\@empty \lst@MakeActive@#1% + \relax\relax\relax\relax\relax\relax\relax\relax\relax} +\begingroup +\catcode`\^^@=\active \catcode`\^^A=\active \catcode`\^^B=\active +\catcode`\^^C=\active \catcode`\^^D=\active \catcode`\^^E=\active +\catcode`\^^F=\active \catcode`\^^G=\active \catcode`\^^H=\active +\gdef\lst@MakeActive@#1#2#3#4#5#6#7#8#9{\let\lst@next\relax + \ifx#1\relax + \else \lccode`\^^@=`#1% + \ifx#2\relax + \lowercase{\lst@lAddTo\lst@temp{^^@}}% + \else \lccode`\^^A=`#2% + \ifx#3\relax + \lowercase{\lst@lAddTo\lst@temp{^^@^^A}}% + \else \lccode`\^^B=`#3% + \ifx#4\relax + \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B}}% + \else \lccode`\^^C=`#4% + \ifx#5\relax + \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C}}% + \else \lccode`\^^D=`#5% + \ifx#6\relax + \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D}}% + \else \lccode`\^^E=`#6% + \ifx#7\relax + \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E}}% + \else \lccode`\^^F=`#7% + \ifx#8\relax + \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E^^F}}% + \else \lccode`\^^G=`#8% + \ifx#9\relax + \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E^^F^^G}}% + \else \lccode`\^^H=`#9% + \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E^^F^^G^^H}}% + \let\lst@next\lst@MakeActive@ + \fi \fi \fi \fi \fi \fi \fi \fi \fi + \lst@next} +\endgroup +\def\lst@DefActive#1#2{\lst@MakeActive{#2}\let#1\lst@temp} +\def\lst@DefOther#1#2{% + \begingroup \def#1{#2}\escapechar\m@ne \expandafter\endgroup + \expandafter\lst@DefOther@\meaning#1\relax#1} +\def\lst@DefOther@#1>#2\relax#3{\edef#3{\zap@space#2 \@empty}} +\def\lst@InsideConvert#1{% + \lst@ifmathescape + \lst@InsideConvert@e#1$\@nil + \lst@if + \lst@InsideConvert@ey#1\@nil + \else + \lst@InsideConvert@#1 \@empty + \expandafter\@gobbletwo + \fi + \expandafter\lst@next + \else + \lst@InsideConvert@#1 \@empty + \fi} +\begingroup \lccode`\~=`\ \relax \lowercase{% +\gdef\lst@InsideConvert@#1 #2{% + \lst@MakeActive{#1}% + \ifx\@empty#2% + \lst@lExtend\lst@arg{\lst@temp}% + \else + \lst@lExtend\lst@arg{\lst@temp~}% + \expandafter\lst@InsideConvert@ + \fi #2} +}\endgroup +\def\lst@InsideConvert@e#1$#2\@nil{% + \ifx\@empty#2\@empty \lst@false \else \lst@true \fi} +\def\lst@InsideConvert@ey#1$#2$#3\@nil{% + \lst@InsideConvert@#1 \@empty + \lst@lAddTo\lst@arg{% + \lst@ifdropinput\else + \lst@TrackNewLines\lst@OutputLostSpace \lst@XPrintToken + \setbox\@tempboxa=\hbox\bgroup$\lst@escapebegin + #2% + \lst@escapeend$\egroup \lst@CalcLostSpaceAndOutput + \lst@whitespacefalse + \fi}% + \def\lst@next{\lst@InsideConvert{#3}}% +} +\def\lst@XConvert{\@ifnextchar\bgroup \lst@XConvertArg\lst@XConvert@} +\def\lst@XConvertArg#1{% + {\lst@false \let\lst@arg\@empty + \lst@XConvert#1\@nil + \global\let\@gtempa\lst@arg}% + \lst@lExtend\lst@arg{\expandafter{\@gtempa}}% + \lst@XConvertNext} +\def\lst@XConvert@#1{% + \ifx\@nil#1\else + \begingroup\lccode`\~=`#1\lowercase{\endgroup + \lst@lAddTo\lst@arg~}% + \expandafter\lst@XConvertNext + \fi} +\def\lst@XConvertNext{% + \lst@if \expandafter\lst@XConvertX + \else \expandafter\lst@XConvert \fi} +\def\lst@XConvertX#1{% + \ifx\@nil#1\else + \lst@XConvertX@#1\relax + \expandafter\lst@XConvert + \fi} +\def\lst@XConvertX@#1#2\relax{% + \begingroup\lccode`\~=`#1\lowercase{\endgroup + \lst@XCConvertX@@~}{#2}} +\def\lst@XCConvertX@@#1#2{\lst@lAddTo\lst@arg{{#1#2}}} +\def\lst@Require#1#2#3#4#5{% + \begingroup + \aftergroup\lst@true + \ifx\@empty#3\@empty\else + \def\lst@prefix{#2}\let\lst@require\@empty + \edef\lst@temp{\expandafter\zap@space#3 \@empty}% + \lst@for\lst@temp\do{% + \ifx\@empty##1\@empty\else \lstKV@OptArg[]{##1}{% + #4[####1]{####2}% + \@ifundefined{\@lst\lst@prefix @\lst@malias $\lst@oalias}% + {\edef\lst@require{\lst@require,\lst@malias $\lst@oalias}}% + {}}% + \fi}% + \global\let\lst@loadaspects\@empty + \lst@InputCatcodes + \ifx\lst@require\@empty\else + \lst@for{#5}\do{% + \ifx\lst@require\@empty\else + \InputIfFileExists{##1}{}{}% + \fi}% + \fi + \ifx\lst@require\@empty\else + \PackageError{Listings}{Couldn't load requested #1}% + {The following #1s weren't loadable:^^J\@spaces + \lst@require^^JThis may cause errors in the sequel.}% + \aftergroup\lst@false + \fi + \ifx\lst@loadaspects\@empty\else + \lst@RequireAspects\lst@loadaspects + \fi + \fi + \endgroup} +\def\lst@IfRequired[#1]#2{% + \lst@NormedDef\lst@temp{[#1]#2}% + \expandafter\lst@IfRequired@\lst@temp\relax} +\def\lst@IfRequired@[#1]#2\relax#3{% + \lst@IfOneOf #2$#1\relax\lst@require + {\lst@DeleteKeysIn@\lst@require#2$#1,\relax,% + \global\expandafter\let + \csname\@lst\lst@prefix @#2$#1\endcsname\@empty + #3}} +\let\lst@require\@empty +\def\lst@NoAlias[#1]#2{% + \lst@NormedDef\lst@oalias{#1}\lst@NormedDef\lst@malias{#2}} +\gdef\lst@LAS#1#2#3#4#5#6#7{% + \lst@Require{#1}{#2}{#3}#4#5% + #4#3% + \@ifundefined{lst#2@\lst@malias$\lst@oalias}% + {\PackageError{Listings}% + {#1 \ifx\@empty\lst@oalias\else \lst@oalias\space of \fi + \lst@malias\space undefined}% + {The #1 is not loadable. \@ehc}}% + {#6\csname\@lst#2@\lst@malias $\lst@oalias\endcsname #7}} +\def\lst@RequireAspects#1{% + \lst@Require{aspect}{asp}{#1}\lst@NoAlias\lstaspectfiles} +\let\lstloadaspects\lst@RequireAspects +\@ifundefined{lstaspectfiles} + {\newcommand\lstaspectfiles{lstmisc0.sty,lstmisc.sty}}{} +\gdef\lst@DefDriver#1#2#3#4{% + \@ifnextchar[{\lst@DefDriver@{#1}{#2}#3#4}% + {\lst@DefDriver@{#1}{#2}#3#4[]}} +\gdef\lst@DefDriver@#1#2#3#4[#5]#6{% + \def\lst@name{#1}\let\lst@if#4% + \lst@NormedDef\lst@driver{\@lst#2@#6$#5}% + \lst@IfRequired[#5]{#6}{\begingroup \lst@true}% + {\begingroup}% + \lst@setcatcodes + \@ifnextchar[{\lst@XDefDriver{#1}#3}{\lst@DefDriver@@#3}} +\gdef\lst@DefDriver@@#1#2{% + \lst@if + \global\@namedef{\lst@driver}{#1{#2}}% + \fi + \endgroup + \@ifnextchar[\lst@XXDefDriver\@empty} +\gdef\lst@XXDefDriver[#1]{% + \ifx\@empty#1\@empty\else + \lst@if + \lstloadaspects{#1}% + \else + \@ifundefined{\lst@driver}{}% + {\xdef\lst@loadaspects{\lst@loadaspects,#1}}% + \fi + \fi} +\gdef\lst@XDefDriver#1#2[#3]#4#5{\lst@DefDriver@@#2{also#1=[#3]#4,#5}} +\let\lst@UserCommand\gdef +\newcommand*\lst@BeginAspect[2][]{% + \def\lst@curraspect{#2}% + \ifx \lst@curraspect\@empty + \expandafter\lst@GobbleAspect + \else + \let\lst@next\@empty + \lst@IfRequired[]{#2}% + {\lst@RequireAspects{#1}% + \lst@if\else \let\lst@next\lst@GobbleAspect \fi}% + {\let\lst@next\lst@GobbleAspect}% + \expandafter\lst@next + \fi} +\def\lst@EndAspect{% + \csname\@lst patch@\lst@curraspect\endcsname + \let\lst@curraspect\@empty} +\long\def\lst@GobbleAspect#1\lst@EndAspect{\let\lst@curraspect\@empty} +\def\lst@Key#1#2{% + \@ifnextchar[{\lstKV@def{#1}{#2}}% + {\def\lst@temp{\lst@Key@{#1}{#2}} + \afterassignment\lst@temp + \global\@namedef{KV@\@lst @#1}####1}} +\def\lstKV@def#1#2[#3]{% + \global\@namedef{KV@\@lst @#1@default\expandafter}\expandafter + {\csname KV@\@lst @#1\endcsname{#3}}% + \def\lst@temp{\lst@Key@{#1}{#2}}\afterassignment\lst@temp + \global\@namedef{KV@\@lst @#1}##1} +\def\lst@Key@#1#2{% + \ifx\relax#2\@empty\else |