/[escript]/branches/scons-dev/doc/user/lstmisc.sty
ViewVC logotype

Annotation of /branches/scons-dev/doc/user/lstmisc.sty

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1384 - (hide annotations)
Fri Jan 11 02:29:38 2008 UTC (12 years, 7 months ago) by phornby
Original Path: temp_trunk_copy/doc/user/lstmisc.sty
File size: 74569 byte(s)
Make a temp copy of the trunk before checking in the windows changes


1 jgs 82 % $Id$
2    
3     %%
4     %% This is file `lstmisc.sty',
5     %% generated with the docstrip utility.
6     %%
7     %% The original source files were:
8     %%
9     %% listings.dtx (with options: `misc,0.21')
10     %%
11     %% Please read the software license in listings.dtx or listings.pdf.
12     %%
13     %% (w)(c) 1996 -- 2003 Carsten Heinz and/or any other author
14     %% listed elsewhere in this file.
15     %%
16     %% This file is distributed under the terms of the LaTeX Project Public
17     %% License from CTAN archives in directory macros/latex/base/lppl.txt.
18     %% Either version 1.0 or, at your option, any later version.
19     %%
20     %% Permission is granted to modify this file. If your changes are of
21     %% general interest, please contact the address below.
22     %%
23     %% Send comments and ideas on the package, error reports and additional
24     %% programming languages to <cheinz@gmx.de>.
25     %%
26     \def\filedate{2003/06/21}
27     \def\fileversion{1.1}
28     \ProvidesFile{lstmisc.sty}
29     [\filedate\space\fileversion\space(Carsten Heinz)]
30     \lst@CheckVersion\fileversion
31     {\typeout{^^J%
32     ***^^J%
33     *** This file requires `listings.sty' version \fileversion.^^J%
34     *** You have a serious problem, so I'm exiting ...^^J%
35     ***^^J}%
36     \batchmode \@@end}
37     \lst@BeginAspect{writefile}
38     \newtoks\lst@WFtoken % global
39     \lst@AddToHook{InitVarsBOL}{\global\lst@WFtoken{}}
40     \newwrite\lst@WF
41     \global\let\lst@WFifopen\iffalse % init
42     \gdef\lst@WFWriteToFile{%
43     \begingroup
44     \let\lst@UM\@empty
45     \expandafter\edef\expandafter\lst@temp\expandafter{\the\lst@WFtoken}%
46     \immediate\write\lst@WF{\lst@temp}%
47     \endgroup
48     \global\lst@WFtoken{}}
49     \gdef\lst@WFAppend#1{%
50     \global\lst@WFtoken=\expandafter{\the\lst@WFtoken#1}}
51     \gdef\lst@BeginWriteFile{\lst@WFBegin\@gobble}
52     \gdef\lst@BeginAlsoWriteFile{\lst@WFBegin\lst@OutputBox}
53     \begingroup \catcode`\^^I=11
54     \gdef\lst@WFBegin#1#2{%
55     \begingroup
56     \let\lst@OutputBox#1%
57     \def\lst@Append##1{%
58     \advance\lst@length\@ne
59     \expandafter\lst@token\expandafter{\the\lst@token##1}%
60     \ifx ##1\lst@outputspace \else
61     \lst@WFAppend##1%
62     \fi}%
63     \lst@lAddTo\lst@PreGotoTabStop{\lst@WFAppend{^^I}}%
64     \lst@lAddTo\lst@ProcessSpace{\lst@WFAppend{ }}%
65     \let\lst@DeInit\lst@WFDeInit
66     \let\lst@MProcessListing\lst@WFMProcessListing
67     \lst@WFifopen\else
68     \immediate\openout\lst@WF=#2\relax
69     \global\let\lst@WFifopen\iftrue
70     \@gobbletwo\fi\fi
71     \fi}
72     \endgroup
73     \gdef\lst@EndWriteFile{%
74     \immediate\closeout\lst@WF \endgroup
75     \global\let\lst@WFifopen\iffalse}
76     \global\let\lst@WFMProcessListing\lst@MProcessListing
77     \global\let\lst@WFDeInit\lst@DeInit
78     \lst@AddToAtTop\lst@WFMProcessListing{\lst@WFWriteToFile}
79     \lst@AddToAtTop\lst@WFDeInit{%
80     \ifnum\lst@length=\z@\else \lst@WFWriteToFile \fi}
81     \lst@EndAspect
82     \lst@BeginAspect{strings}
83     \gdef\lst@stringtypes{d,b,m,bd,db}
84     \gdef\lst@StringKey#1#2{%
85     \lst@Delim\lst@stringstyle #2\relax
86     {String}\lst@stringtypes #1%
87     {\lst@BeginString\lst@EndString}%
88     \@@end\@empty{}}
89     \lst@Key{string}\relax{\lst@StringKey\@empty{#1}}
90     \lst@Key{morestring}\relax{\lst@StringKey\relax{#1}}
91     \lst@Key{deletestring}\relax{\lst@StringKey\@nil{#1}}
92     \lst@Key{stringstyle}{}{\def\lst@stringstyle{#1}}
93     \lst@AddToHook{EmptyStyle}{\let\lst@stringstyle\@empty}
94     \lst@Key{showstringspaces}t[t]{\lstKV@SetIf{#1}\lst@ifshowstringspaces}
95     \gdef\lst@BeginString{%
96     \lst@DelimOpen
97     \lst@ifexstrings\else
98     {\lst@ifshowstringspaces
99     \lst@keepspacestrue
100     \let\lst@outputspace\lst@visiblespace
101     \fi}}
102     \lst@AddToHookExe{ExcludeDelims}{\let\lst@ifexstrings\iffalse}
103     \gdef\lst@EndString{\lst@DelimClose\lst@ifexstrings\else}
104     \gdef\lst@StringDM@d#1#2\@empty#3#4#5{%
105     \lst@CArg #2\relax\lst@DefDelimBE{}{}{}#3{#1}{#5}#4}
106     \gdef\lst@StringDM@b#1#2\@empty#3#4#5{%
107     \let\lst@ifbstring\iftrue
108     \lst@CArg #2\relax\lst@DefDelimBE
109     {\lst@ifletter \lst@Output \lst@letterfalse \fi}%
110     {\ifx\lst@lastother\lstum@backslash
111     \expandafter\@gobblethree
112     \fi}{}#3{#1}{#5}#4}
113     \global\let\lst@ifbstring\iffalse % init
114     \lst@AddToHook{SelectCharTable}{%
115     \lst@ifbstring
116     \lst@CArgX \\\\\relax \lst@CDefX{}%
117     {\lst@ProcessOther\lstum@backslash
118     \lst@ProcessOther\lstum@backslash
119     \let\lst@lastother\relax}%
120     {}%
121     \fi}
122     \global\let\lst@StringDM@bd\lst@StringDM@b
123     \global\let\lst@StringDM@db\lst@StringDM@bd
124     \gdef\lst@StringDM@a#1#2\@empty#3#4#5{%
125     \lst@CArg #2\relax\lst@DefDelimBE{}{}%
126     {\let\lst@next\@gobblethree
127     \lst@ifletter\else
128     \ifx\lst@lastother)\else \ifx\lst@lastother]\else
129     \let\lst@next\@empty
130     \fi \fi \fi
131     \lst@next}#3{#1}{#5}#4}
132     \gdef\lst@StringDM@m#1#2\@empty#3#4#5{%
133     \lst@CArg #2\relax\lst@DefDelimBE{}{}%
134     {\let\lst@next\@gobblethree
135     \lst@ifletter\else
136     \lst@IfLastOtherOneOf{)].0123456789\lstum@rbrace'}%
137     {}%
138     {\let\lst@next\@empty}%
139     \fi
140     \lst@next}#3{#1}{#5}#4}
141     \lst@SaveOutputDef{"7D}\lstum@rbrace
142     \lst@EndAspect
143     \lst@BeginAspect{comments}
144     \lst@NewMode\lst@commentmode
145     \gdef\lst@commenttypes{l,f,s,n}
146     \gdef\lst@CommentKey#1#2{%
147     \lst@Delim\lst@commentstyle #2\relax
148     {Comment}\lst@commenttypes #1%
149     {\lst@BeginComment\lst@EndComment}%
150     i\@empty{\lst@BeginInvisible\lst@EndInvisible}}
151     \lst@Key{comment}\relax{\lst@CommentKey\@empty{#1}}
152     \lst@Key{morecomment}\relax{\lst@CommentKey\relax{#1}}
153     \lst@Key{deletecomment}\relax{\lst@CommentKey\@nil{#1}}
154     \lst@Key{commentstyle}{}{\def\lst@commentstyle{#1}}
155     \lst@AddToHook{EmptyStyle}{\let\lst@commentstyle\itshape}
156     \gdef\lst@BeginComment{%
157     \lst@DelimOpen
158     \lst@ifexcomments\else
159     \lsthk@AfterBeginComment}
160     \gdef\lst@EndComment{\lst@DelimClose\lst@ifexcomments\else}
161     \lst@AddToHook{AfterBeginComment}{}
162     \lst@AddToHookExe{ExcludeDelims}{\let\lst@ifexcomments\iffalse}
163     \gdef\lst@BeginInvisible#1#2#3\@empty{%
164     \lst@TrackNewLines \lst@XPrintToken
165     \lst@BeginDropOutput{#1}}
166     \gdef\lst@EndInvisible#1\@empty{\lst@EndDropOutput}
167     \gdef\lst@CommentDM@l#1#2\@empty#3#4#5{%
168     \lst@CArg #2\relax\lst@DefDelimB{}{}{}#3{#1}{#5\lst@Lmodetrue}}
169     \gdef\lst@CommentDM@f#1{%
170     \@ifnextchar[{\lst@Comment@@f{#1}}%
171     {\lst@Comment@@f{#1}[0]}}
172     \gdef\lst@Comment@@f#1[#2]#3\@empty#4#5#6{%
173     \lst@CArg #3\relax\lst@DefDelimB{}{}%
174     {\lst@CalcColumn
175     \ifnum #2=\@tempcnta\else
176     \expandafter\@gobblethree
177     \fi}%
178     #4{#1}{#6\lst@Lmodetrue}}
179     \gdef\lst@CommentDM@s#1#2#3\@empty#4#5#6{%
180     \lst@CArg #2\relax\lst@DefDelimB{}{}{}#4{#1}{#6}%
181     \lst@CArg #3\relax\lst@DefDelimE{}{}{}#5{#1}}
182     \gdef\lst@CommentDM@n#1#2#3\@empty#4#5#6{%
183     \ifx\@empty#3\@empty\else
184     \def\@tempa{#2}\def\@tempb{#3}%
185     \ifx\@tempa\@tempb
186     \PackageError{Listings}{Identical delimiters}%
187     {These delimiters make no sense with nested comments.}%
188     \else
189     \lst@CArg #2\relax\lst@DefDelimB
190     {}%
191     {\ifnum\lst@mode=#1\relax \expandafter\@gobble \fi}%
192     {}#4{#1}{#6}%
193     \lst@CArg #3\relax\lst@DefDelimE{}{}{}#5{#1}%
194     \fi
195     \fi}
196     \lst@EndAspect
197     \lst@BeginAspect{pod}
198     \lst@Key{printpod}{false}[t]{\lstKV@SetIf{#1}\lst@ifprintpod}
199     \lst@Key{podcomment}{false}[t]{\lstKV@SetIf{#1}\lst@ifpodcomment}
200     \lst@AddToHookExe{SetLanguage}{\let\lst@ifpodcomment\iffalse}
201     \lst@NewMode\lst@PODmode
202     \lst@AddToHook{SelectCharTable}
203     {\lst@ifpodcomment
204     \lst@CArgX =\relax\lst@DefDelimB{}{}%
205     {\ifnum\@tempcnta=\z@
206     \lst@ifprintpod\else
207     \def\lst@bnext{\lst@BeginDropOutput\lst@PODmode}%
208     \expandafter\expandafter\expandafter\@gobblethree
209     \fi
210     \else
211     \expandafter\@gobblethree
212     \fi}%
213     \lst@BeginComment\lst@PODmode{{\lst@commentstyle}}%
214     \lst@CArgX =cut\^^M\relax\lst@DefDelimE
215     {\lst@CalcColumn}%
216     {\ifnum\@tempcnta=\z@\else
217     \expandafter\@gobblethree
218     \fi}%
219     {}%
220     \lst@EndComment\lst@PODmode
221     \fi}
222     \lst@EndAspect
223     \lst@BeginAspect[keywords]{html}
224     \gdef\lst@tagtypes{s}
225     \gdef\lst@TagKey#1#2{%
226     \lst@Delim\lst@tagstyle #2\relax
227     {Tag}\lst@tagtypes #1%
228     {\lst@BeginTag\lst@EndTag}%
229     \@@end\@empty{}}
230     \lst@Key{tag}\relax{\lst@TagKey\@empty{#1}}
231     \lst@Key{tagstyle}{}{\def\lst@tagstyle{#1}}
232     \lst@AddToHook{EmptyStyle}{\let\lst@tagstyle\@empty}
233     \gdef\lst@BeginTag{%
234     \lst@DelimOpen
235     \lst@ifextags\else
236     {\let\lst@ifkeywords\iftrue
237     \lst@ifmarkfirstintag \lst@firstintagtrue \fi}}
238     \lst@AddToHookExe{ExcludeDelims}{\let\lst@ifextags\iffalse}
239     \gdef\lst@EndTag{\lst@DelimClose\lst@ifextags\else}
240     \lst@Key{usekeywordsintag}t[t]{\lstKV@SetIf{#1}\lst@ifusekeysintag}
241     \lst@Key{markfirstintag}f[t]{\lstKV@SetIf{#1}\lst@ifmarkfirstintag}
242     \gdef\lst@firstintagtrue{\global\let\lst@iffirstintag\iftrue}
243     \global\let\lst@iffirstintag\iffalse
244     \lst@AddToHook{PostOutput}{\lst@tagresetfirst}
245     \lst@AddToHook{Output}
246     {\gdef\lst@tagresetfirst{\global\let\lst@iffirstintag\iffalse}}
247     \lst@AddToHook{OutputOther}{\gdef\lst@tagresetfirst{}}
248     \lst@AddToHook{Output}
249     {\ifnum\lst@mode=\lst@tagmode
250     \lst@iffirstintag \let\lst@thestyle\lst@gkeywords@sty \fi
251     \lst@ifusekeysintag\else \let\lst@thestyle\lst@gkeywords@sty\fi
252     \fi}
253     \lst@NewMode\lst@tagmode
254     \lst@AddToHook{Init}{\global\let\lst@ifnotag\iftrue}
255     \lst@AddToHook{SelectCharTable}{\let\lst@ifkeywords\lst@ifnotag}
256     \gdef\lst@Tag@s#1#2\@empty#3#4#5{%
257     \global\let\lst@ifnotag\iffalse
258     \lst@CArg #1\relax\lst@DefDelimB {}{}%
259     {\ifnum\lst@mode=\lst@tagmode \expandafter\@gobblethree \fi}%
260     #3\lst@tagmode{#5}%
261     \lst@CArg #2\relax\lst@DefDelimE {}{}{}#4\lst@tagmode}%
262     \gdef\lst@BeginCDATA#1\@empty{%
263     \lst@TrackNewLines \lst@PrintToken
264     \lst@EnterMode\lst@GPmode{}\let\lst@ifmode\iffalse
265     \lst@mode\lst@tagmode #1\lst@mode\lst@GPmode\relax\lst@modetrue}
266     \lst@EndAspect
267     \lst@BeginAspect{escape}
268     \lst@Key{texcl}{false}[t]{\lstKV@SetIf{#1}\lst@iftexcl}
269     \lst@AddToHook{TextStyle}{\let\lst@iftexcl\iffalse}
270     \lst@AddToHook{EOL}
271     {\ifnum\lst@mode=\lst@TeXLmode
272     \expandafter\lst@escapeend
273     \expandafter\lst@LeaveAllModes
274     \expandafter\lst@ReenterModes
275     \fi}
276     \lst@AddToHook{AfterBeginComment}
277     {\lst@iftexcl \lst@ifLmode \lst@ifdropinput\else
278     \lst@PrintToken
279     \lst@LeaveMode \lst@InterruptModes
280     \lst@EnterMode{\lst@TeXLmode}{\lst@modetrue\lst@commentstyle}%
281     \expandafter\expandafter\expandafter\lst@escapebegin
282     \fi \fi \fi}
283     \lst@NewMode\lst@TeXLmode
284     \gdef\lst@ActiveCDefX#1{\lst@ActiveCDefX@#1}
285     \gdef\lst@ActiveCDefX@#1#2#3{
286     \catcode`#1\active\lccode`\~=`#1%
287     \lowercase{\lst@CDefIt~}{#2}{#3}{}}
288     \gdef\lst@Escape#1#2#3#4{%
289     \lst@CArgX #1\relax\lst@CDefX
290     {}%
291     {\lst@ifdropinput\else
292     \lst@TrackNewLines\lst@OutputLostSpace \lst@XPrintToken
293     \lst@InterruptModes
294     \lst@EnterMode{\lst@TeXmode}{\lst@modetrue}%
295     \ifx\^^M#2%
296     \lst@CArg #2\relax\lst@ActiveCDefX
297     {}%
298     {\lst@escapeend #4\lst@LeaveAllModes\lst@ReenterModes}%
299     {\lst@MProcessListing}%
300     \else
301     \lst@CArg #2\relax\lst@ActiveCDefX
302     {}%
303     {\lst@escapeend #4\lst@LeaveAllModes\lst@ReenterModes
304     \lst@whitespacefalse}%
305     {}%
306     \fi
307     #3\lst@escapebegin
308     \fi}%
309     {}}
310     \lst@NewMode\lst@TeXmode
311     \lst@Key{escapebegin}{}{\def\lst@escapebegin{#1}}
312     \lst@Key{escapeend}{}{\def\lst@escapeend{#1}}
313     \lst@Key{escapechar}{}
314     {\ifx\@empty#1\@empty
315     \let\lst@DefEsc\relax
316     \else
317     \def\lst@DefEsc{\lst@Escape{#1}{#1}{}{}}%
318     \fi}
319     \lst@AddToHook{TextStyle}{\let\lst@DefEsc\@empty}
320     \lst@AddToHook{SelectCharTable}{\lst@DefEsc}
321     \lst@Key{escapeinside}{}{\lstKV@TwoArg{#1}%
322     {\let\lst@DefEsc\@empty
323     \ifx\@empty##1@empty\else \ifx\@empty##2\@empty\else
324     \def\lst@DefEsc{\lst@Escape{##1}{##2}{}{}}%
325     \fi\fi}}
326     \lst@Key{mathescape}{false}[t]{\lstKV@SetIf{#1}\lst@ifmathescape}
327     \lst@AddToHook{SelectCharTable}
328     {\lst@ifmathescape \lst@Escape{\$}{\$}%
329     {\setbox\@tempboxa=\hbox\bgroup$}%
330     {$\egroup \lst@CalcLostSpaceAndOutput}\fi}
331     \lst@EndAspect
332     \lst@BeginAspect{keywords}
333     \global\let\lst@ifsensitive\iftrue % init
334     \global\let\lst@ifsensitivedefed\iffalse % init % \global
335     \lst@ifsavemem\else
336     \gdef\lst@KeywordTest#1#2#3{%
337     \begingroup \let\lst@UM\@empty
338     \global\expandafter\let\expandafter\@gtempa
339     \csname\@lst#1@\the\lst@token\endcsname
340     \endgroup
341     \ifx\@gtempa\relax\else
342     \let\lst@thestyle\@gtempa
343     \fi}
344     \gdef\lst@KEYWORDTEST{%
345     \uppercase\expandafter{\expandafter
346     \lst@KEYWORDTEST@\the\lst@token}\relax}
347     \gdef\lst@KEYWORDTEST@#1\relax#2#3#4{%
348     \begingroup \let\lst@UM\@empty
349     \global\expandafter\let\expandafter\@gtempa
350     \csname\@lst#2@#1\endcsname
351     \endgroup
352     \ifx\@gtempa\relax\else
353     \let\lst@thestyle\@gtempa
354     \fi}
355     \gdef\lst@WorkingTest#1#2#3{%
356     \begingroup \let\lst@UM\@empty
357     \global\expandafter\let\expandafter\@gtempa
358     \csname\@lst#1@\the\lst@token\endcsname
359     \endgroup
360     \@gtempa}
361     \gdef\lst@WORKINGTEST{%
362     \uppercase\expandafter{\expandafter
363     \lst@WORKINGTEST@\the\lst@token}\relax}
364     \gdef\lst@WORKINGTEST@#1\relax#2#3#4{%
365     \begingroup \let\lst@UM\@empty
366     \global\expandafter\let\expandafter\@gtempa
367     \csname\@lst#2@#1\endcsname
368     \endgroup
369     \@gtempa}
370     \gdef\lst@DefineKeywords#1#2#3{%
371     \lst@ifsensitive
372     \def\lst@next{\lst@for#2}%
373     \else
374     \def\lst@next{\uppercase\expandafter{\expandafter\lst@for#2}}%
375     \fi
376     \lst@next\do
377     {\expandafter\ifx\csname\@lst#1@##1\endcsname\relax
378     \global\expandafter\let\csname\@lst#1@##1\endcsname#3%
379     \fi}}
380     \gdef\lst@UndefineKeywords#1#2#3{%
381     \lst@ifsensitivedefed
382     \def\lst@next{\lst@for#2}%
383     \else
384     \def\lst@next{\uppercase\expandafter{\expandafter\lst@for#2}}%
385     \fi
386     \lst@next\do
387     {\expandafter\ifx\csname\@lst#1@##1\endcsname#3%
388     \global\expandafter\let\csname\@lst#1@##1\endcsname\relax
389     \fi}}
390     \fi
391     \lst@ifsavemem
392     \gdef\lst@IfOneOutOf#1\relax#2{%
393     \def\lst@temp##1,#1,##2##3\relax{%
394     \ifx\@empty##2\else \expandafter\lst@IOOOfirst \fi}%
395     \def\lst@next{\lst@IfOneOutOf@#1\relax}%
396     \expandafter\lst@next#2\relax\relax}
397     \gdef\lst@IfOneOutOf@#1\relax#2#3{%
398     \ifx#2\relax
399     \expandafter\@secondoftwo
400     \else
401     \expandafter\lst@temp\expandafter,#2,#1,\@empty\relax
402     \expandafter\lst@next
403     \fi}
404     \ifx\iffalse\else\fi
405     \gdef\lst@IOOOfirst#1\relax#2#3{\fi#2}
406     \gdef\lst@IFONEOUTOF#1\relax#2{%
407     \uppercase{\def\lst@temp##1,#1},##2##3\relax{%
408     \ifx\@empty##2\else \expandafter\lst@IOOOfirst \fi}%
409     \def\lst@next{\lst@IFONEOUTOF@#1\relax}%
410     \expandafter\lst@next#2\relax}
411     \gdef\lst@IFONEOUTOF@#1\relax#2#3{%
412     \ifx#2\relax
413     \expandafter\@secondoftwo
414     \else
415     \uppercase
416     {\expandafter\lst@temp\expandafter,#2,#1,\@empty\relax}%
417     \expandafter\lst@next
418     \fi}
419     \gdef\lst@KWTest{%
420     \begingroup \let\lst@UM\@empty
421     \expandafter\xdef\expandafter\@gtempa\expandafter{\the\lst@token}%
422     \endgroup
423     \expandafter\lst@IfOneOutOf\@gtempa\relax}
424     \gdef\lst@KeywordTest#1#2#3{\lst@KWTest #2{\let\lst@thestyle#3}{}}
425     \global\let\lst@KEYWORDTEST\lst@KeywordTest
426     \gdef\lst@WorkingTest#1#2#3{\lst@KWTest #2#3{}}
427     \global\let\lst@WORKINGTEST\lst@WorkingTest
428     \fi
429     \lst@Key{sensitive}\relax[t]{\lstKV@SetIf{#1}\lst@ifsensitive}
430     \lst@AddToHook{SetLanguage}{\let\lst@ifsensitive\iftrue}
431     \lst@AddToHook{Init}
432     {\lst@ifsensitive\else
433     \let\lst@KeywordTest\lst@KEYWORDTEST
434     \let\lst@WorkingTest\lst@WORKINGTEST
435     \let\lst@IfOneOutOf\lst@IFONEOUTOF
436     \fi}
437     \gdef\lst@MakeMacroUppercase#1{%
438     \ifx\@undefined#1\else \uppercase\expandafter
439     {\expandafter\def\expandafter#1\expandafter{#1}}%
440     \fi}
441     \gdef\lst@InstallTest#1#2#3#4#5#6#7#8{%
442     \lst@AddToHook{TrackKeywords}{\lst@TrackKeywords{#1}#2#4#6#7#8}%
443     \lst@AddToHook{PostTrackKeywords}{\lst@PostTrackKeywords#2#3#4#5}}
444     \lst@AddToHook{Init}{\lsthk@TrackKeywords\lsthk@PostTrackKeywords}
445     \lst@AddToHook{TrackKeywords}{}% init
446     \lst@AddToHook{PostTrackKeywords}{}% init
447     \lst@AddToHook{Output}{\lst@ifkeywords \lsthk@DetectKeywords \fi}
448     \lst@AddToHook{DetectKeywords}{}% init
449     \lst@AddToHook{ModeTrue}{\let\lst@ifkeywords\iffalse}
450     \lst@AddToHook{Init}{\let\lst@ifkeywords\iftrue}
451     \gdef\lst@InstallTestNow#1#2#3#4#5{%
452     \@ifundefined{\string#2#1}%
453     {\global\@namedef{\string#2#1}{}%
454     \edef\@tempa{%
455     \noexpand\lst@AddToHook{\ifx#5dDetectKeywords\else Output\fi}%
456     {\ifx #4w\noexpand\lst@WorkingTest
457     \else\noexpand\lst@KeywordTest \fi
458     {#1}\noexpand#2\noexpand#3}}%
459     \lst@ifsavemem
460     \@tempa
461     \else
462     \@ifundefined{\@lst#1@if@ins}%
463     {\@tempa \global\@namedef{\@lst#1@if@ins}{}}%
464     {}%
465     \fi}
466     {}}
467     \gdef\lst@TrackKeywords#1#2#3#4#5#6{%
468     \lst@false
469     \def\lst@arg{{#1}#4}%
470     \expandafter\expandafter\expandafter\lst@TK@
471     \expandafter\lst@arg#2\relax\relax
472     \lst@ifsavemem\else
473     \def\lst@arg{{#1}#4#2}%
474     \expandafter\expandafter\expandafter\lst@TK@@
475     \expandafter\lst@arg#3\relax\relax
476     \fi
477     \lst@if \lst@InstallTestNow{#1}#2#4#5#6\fi}
478     \gdef\lst@TK@#1#2#3#4{%
479     \ifx\lst@ifsensitive\lst@ifsensitivedefed
480     \ifx#3#4\else
481     \lst@true
482     \lst@ifsavemem\else
483     \lst@UndefineKeywords{#1}#4#2%
484     \lst@DefineKeywords{#1}#3#2%
485     \fi
486     \fi
487     \else
488     \ifx#3\relax\else
489     \lst@true
490     \lst@ifsavemem\else
491     \lst@UndefineKeywords{#1}#4#2%
492     \lst@DefineKeywords{#1}#3#2%
493     \fi
494     \fi
495     \fi
496     \lst@ifsavemem \ifx#3\relax\else
497     \lst@ifsensitive\else \lst@MakeMacroUppercase#3\fi
498     \fi \fi
499     \ifx#3\relax
500     \expandafter\@gobblethree
501     \fi
502     \lst@TK@{#1}#2}
503     \gdef\lst@TK@@#1#2#3#4#5{%
504     \ifx#4\relax
505     \expandafter\@gobblefour
506     \else
507     \lst@IfSubstring{#4#5}#3{}{\lst@UndefineKeywords{#1}#5#2}%
508     \fi
509     \lst@TK@@{#1}#2#3}
510     \lst@AddToHook{InitVars}
511     {\global\let\lst@ifsensitivedefed\lst@ifsensitive}
512     \gdef\lst@PostTrackKeywords#1#2#3#4{%
513     \lst@ifsavemem\else
514     \global\let#3#1%
515     \global\let#4#2%
516     \fi}
517     \lst@Key{classoffset}\z@{\def\lst@classoffset{#1}}
518     \gdef\lst@InstallFamily#1#2#3#4#5{%
519     \lst@Key{#2}\relax{\lst@UseFamily{#2}##1\relax\lst@MakeKeywords}%
520     \lst@Key{more#2}\relax
521     {\lst@UseFamily{#2}##1\relax\lst@MakeMoreKeywords}%
522     \lst@Key{delete#2}\relax
523     {\lst@UseFamily{#2}##1\relax\lst@DeleteKeywords}%
524     \ifx\@empty#3\@empty\else
525     \lst@Key{#3}{#4}{\lstKV@OptArg[\@ne]{##1}%
526     {\@tempcnta\lst@classoffset \advance\@tempcnta####1\relax
527     \@namedef{lst@#3\ifnum\@tempcnta=\@ne\else \the\@tempcnta
528     \fi}{####2}}}%
529     \fi
530     \expandafter\lst@InstallFamily@
531     \csname\@lst @#2@data\expandafter\endcsname
532     \csname\@lst @#5\endcsname {#1}{#2}{#3}}
533     \gdef\lst@InstallFamily@#1#2#3#4#5#6#7#8{%
534     \gdef#1{{#3}{#4}{#5}#2#7}%
535     \long\def\lst@temp##1{#6}%
536     \ifx\lst@temp\@gobble
537     \lst@AddTo#1{s#8}%
538     \else
539     \lst@AddTo#1{w#8}%
540     \global\@namedef{lst@g#4@wp}##1{#6}%
541     \fi}
542     \gdef\lst@UseFamily#1{%
543     \def\lst@family{#1}%
544     \@ifnextchar[\lst@UseFamily@{\lst@UseFamily@[\@ne]}}
545     \gdef\lst@UseFamily@[#1]{%
546     \@tempcnta\lst@classoffset \advance\@tempcnta#1\relax
547     \lst@ProvideFamily\lst@family
548     \lst@UseFamily@a
549     {\lst@family\ifnum\@tempcnta=\@ne\else \the\@tempcnta \fi}}
550     \gdef\lst@UseFamily@a#1{%
551     \expandafter\lst@UseFamily@b
552     \csname\@lst @#1@list\expandafter\endcsname
553     \csname\@lst @#1\expandafter\endcsname
554     \csname\@lst @#1@also\expandafter\endcsname
555     \csname\@lst @g#1\endcsname}
556     \gdef\lst@UseFamily@b#1#2#3#4#5\relax#6{\lstKV@XOptArg[]{#5}#6#1#2#3#4}
557     \gdef\lst@ProvideFamily#1{%
558     \@ifundefined{lstfam@#1\ifnum\@tempcnta=\@ne\else\the\@tempcnta\fi}%
559     {\@namedef{lstfam@#1\ifnum\@tempcnta=\@ne\else \the\@tempcnta\fi}{}%
560     \expandafter\expandafter\expandafter\lst@ProvideFamily@
561     \csname\@lst @#1@data\endcsname
562     {\ifnum\@tempcnta=\@ne\else \the\@tempcnta \fi}}%
563     {}}%
564     \gdef\lst@ProvideFamily@#1#2#3#4#5#6#7#8{%
565     \expandafter\xdef\csname\@lst @g#2#8@sty\endcsname
566     {\if #6w%
567     \expandafter\noexpand\csname\@lst @g#2@wp\endcsname{#8}%
568     \else
569     \expandafter\noexpand\csname\@lst @#3#8\endcsname
570     \fi}%
571     \ifx\@empty#3\@empty\else
572     \edef\lst@temp{\noexpand\lst@AddToHook{Init}{%
573     \noexpand\lst@ProvideStyle\expandafter\noexpand
574     \csname\@lst @#3#8\endcsname\noexpand#4}}%
575     \lst@temp
576     \fi
577     \expandafter\lst@ProvideFamily@@
578     \csname\@lst @#2#8@list\expandafter\endcsname
579     \csname\@lst @#2#8\expandafter\endcsname
580     \csname\@lst @#2#8@also\expandafter\endcsname
581     \csname\@lst @g#2#8@list\expandafter\endcsname
582     \csname\@lst @g#2#8\expandafter\endcsname
583     \csname\@lst @g#2#8@sty\expandafter\endcsname
584     {#1}#5#6#7}
585     \gdef\lst@ProvideFamily@@#1#2#3#4#5#6#7#8{%
586     \gdef#1{#2#5}\global\let#2\@empty \global\let#3\@empty % init
587     \gdef#4{#2#5}\global\let#5\@empty % init
588     \if #8l\relax
589     \lst@AddToHook{SetLanguage}{\def#1{#2#5}\let#2\@empty}%
590     \fi
591     \lst@InstallTest{#7}#1#2#4#5#6}
592     \gdef\lst@InstallKeywords#1#2#3#4#5{%
593     \lst@Key{#2}\relax
594     {\lst@UseFamily{#2}[\@ne]##1\relax\lst@MakeKeywords}%
595     \lst@Key{more#2}\relax
596     {\lst@UseFamily{#2}[\@ne]##1\relax\lst@MakeMoreKeywords}%
597     \lst@Key{delete#2}\relax
598     {\lst@UseFamily{#2}[\@ne]##1\relax\lst@DeleteKeywords}%
599     \ifx\@empty#3\@empty\else
600     \lst@Key{#3}{#4}{\@namedef{lst@#3}{##1}}%
601     \fi
602     \expandafter\lst@InstallFamily@
603     \csname\@lst @#2@data\expandafter\endcsname
604     \csname\@lst @#5\endcsname {#1}{#2}{#3}}
605     \gdef\lst@ProvideStyle#1#2{%
606     \ifx#1\@undefined \let#1#2%
607     \else\ifx#1\relax \let#1#2\fi\fi}
608     \gdef\lst@BuildClassList#1#2,{%
609     \ifx\relax#2\@empty\else
610     \ifx\@empty#2\@empty\else
611     \lst@lExtend#1{\csname\@lst @#2\expandafter\endcsname
612     \csname\@lst @g#2\endcsname}%
613     \fi
614     \expandafter\lst@BuildClassList\expandafter#1
615     \fi}
616     \gdef\lst@DeleteClassesIn#1#2{%
617     \expandafter\lst@DCI@\expandafter#1#2\relax\relax}
618     \gdef\lst@DCI@#1#2#3{%
619     \ifx#2\relax
620     \expandafter\@gobbletwo
621     \else
622     \def\lst@temp##1#2#3##2{%
623     \lst@lAddTo#1{##1}%
624     \ifx ##2\relax\else
625     \expandafter\lst@temp
626     \fi ##2}%
627     \let\@tempa#1\let#1\@empty
628     \expandafter\lst@temp\@tempa#2#3\relax
629     \fi
630     \lst@DCI@#1}
631     \gdef\lst@MakeKeywords[#1]#2#3#4#5#6{%
632     \def#3{#4#6}\let#4\@empty \let#5\@empty
633     \lst@MakeMoreKeywords[#1]{#2}#3#4#5#6}
634     \gdef\lst@MakeMoreKeywords[#1]#2#3#4#5#6{%
635     \lst@BuildClassList#3#1,\relax,%
636     \lst@DefOther\lst@temp{,#2}\lst@lExtend#4\lst@temp}
637     \gdef\lst@DeleteKeywords[#1]#2#3#4#5#6{%
638     \lst@MakeKeywords[#1]{#2}\@tempa\@tempb#5#6%
639     \lst@DeleteClassesIn#3\@tempa
640     \lst@DeleteKeysIn#4\@tempb}
641     \lst@InstallFamily k{keywords}{keywordstyle}\bfseries{keywordstyle}{}ld
642     \lst@Key{ndkeywords}\relax
643     {\lst@UseFamily{keywords}[\tw@]#1\relax\lst@MakeKeywords}%
644     \lst@Key{morendkeywords}\relax
645     {\lst@UseFamily{keywords}[\tw@]#1\relax\lst@MakeMoreKeywords}%
646     \lst@Key{deletendkeywords}\relax
647     {\lst@UseFamily{keywords}[\tw@]#1\relax\lst@DeleteKeywords}%
648     \lst@Key{ndkeywordstyle}\relax{\@namedef{lst@keywordstyle2}{#1}}%
649     \lst@Key{keywordsprefix}\relax{\lst@DefActive\lst@keywordsprefix{#1}}
650     \global\let\lst@keywordsprefix\@empty
651     \lst@AddToHook{SelectCharTable}
652     {\ifx\lst@keywordsprefix\@empty\else
653     \expandafter\lst@CArg\lst@keywordsprefix\relax
654     \lst@CDef{}%
655     {\lst@ifletter\else
656     \global\let\lst@prefixkeyword\@empty
657     \fi}%
658     {}%
659     \fi}
660     \lst@AddToHook{Init}{\global\let\lst@prefixkeyword\relax}
661     \lst@AddToHook{Output}
662     {\ifx\lst@prefixkeyword\@empty
663     \let\lst@thestyle\lst@gkeywords@sty
664     \global\let\lst@prefixkeyword\relax
665     \fi}%
666     \lst@Key{otherkeywords}{}{%
667     \let\lst@otherkeywords\@empty
668     \lst@for{#1}\do{%
669     \lst@MakeActive{##1}%
670     \lst@lExtend\lst@otherkeywords{%
671     \expandafter\lst@CArg\lst@temp\relax\lst@CDef
672     {}\lst@PrintOtherKeyword\@empty}}}
673     \lst@AddToHook{SelectCharTable}{\lst@otherkeywords}
674     \gdef\lst@PrintOtherKeyword#1\@empty{%
675     \lst@XPrintToken
676     \begingroup
677     \lst@modetrue \lsthk@TextStyle
678     \let\lst@ProcessDigit\lst@ProcessLetter
679     \let\lst@ProcessOther\lst@ProcessLetter
680     \lst@lettertrue
681     \lst@gkeywords@sty{#1\lst@XPrintToken}%
682     \endgroup}
683     \lst@EndAspect
684     \lst@BeginAspect[keywords]{emph}
685     \lst@InstallFamily e{emph}{emphstyle}{}{emphstyle}{}od
686     \lst@EndAspect
687     \lst@BeginAspect[keywords]{tex}
688     \lst@InstallKeywords{cs}{texcs}{texcsstyle}\relax{keywordstyle}
689     {\ifx\lst@lastother\lstum@backslash
690     \let\lst@thestyle\lst@texcsstyle
691     \fi}
692     ld
693     \lst@EndAspect
694     \lst@BeginAspect[keywords]{directives}
695     \lst@NewMode\lst@CDmode
696     \lst@AddToHook{EOL}{\ifnum\lst@mode=\lst@CDmode \lst@LeaveMode \fi}
697     \lst@InstallKeywords{d}{directives}{directivestyle}\relax{keywordstyle}
698     {\ifnum\lst@mode=\lst@CDmode
699     \let\lst@thestyle\lst@directivestyle
700     \fi}
701     ld
702     \global\let\lst@directives\@empty % init
703     \lst@AddToHook{SelectCharTable}
704     {\ifx\lst@directives\@empty\else
705     \lst@DefSaveDef{`\#}\lsts@CCD
706     {\lst@CalcColumn
707     \lst@ifmode\else
708     \ifnum\@tempcnta=\z@
709     \lst@EnterMode{\lst@CDmode}{}%
710     \fi
711     \fi
712     \ifnum\lst@mode=\lst@CDmode
713     \ifnum\@tempcnta=\z@
714     \lst@XPrintToken
715     {\let\lst@currstyle\lst@directivestyle
716     \lsts@CCD\lst@PrintToken}%
717     \else \lsts@CCD
718     \fi
719     \else \lsts@CCD
720     \fi}%
721     \fi}
722     \lst@AddTo\lst@stringtypes{,directive}
723     \gdef\lst@StringDM@directive#1#2#3\@empty{%
724     \lst@CArg #2\relax\lst@CDef
725     {}%
726     {\let\lst@bnext\lst@CArgEmpty
727     \ifnum\lst@mode=\lst@CDmode
728     \def\lst@bnext{\lst@BeginString{#1}}%
729     \fi
730     \lst@bnext}%
731     \@empty
732     \lst@CArg #3\relax\lst@CDef
733     {}%
734     {\let\lst@enext\lst@CArgEmpty
735     \ifnum #1=\lst@mode
736     \let\lst@bnext\lst@EndString
737     \fi
738     \lst@bnext}%
739     \@empty}
740     \lst@EndAspect
741     \lst@BeginAspect[keywords,comments]{keywordcomments}
742     \lst@NewMode\lst@KCmode \lst@NewMode\lst@KCSmode
743     \gdef\lst@BeginKC{\aftergroup\aftergroup\aftergroup\lst@BeginKC@}%
744     \gdef\lst@BeginKC@{%
745     \lst@ResetToken
746     \lst@BeginComment\lst@KCmode{{\lst@commentstyle}\lst@modetrue}%
747     \@empty}%
748     \gdef\lst@BeginKCS{\aftergroup\aftergroup\aftergroup\lst@BeginKCS@}%
749     \gdef\lst@BeginKCS@{%
750     \lst@ResetToken
751     \lst@BeginComment\lst@KCSmode{{\lst@commentstyle}\lst@modetrue}%
752     \@empty}%
753     \lst@AddToHook{PostOutput}{\lst@KCpost \global\let\lst@KCpost\@empty}
754     \global\let\lst@KCpost\@empty % init
755     \gdef\lst@EndKC{\lst@SaveToken \lst@LeaveMode \lst@RestoreToken
756     \let\lst@thestyle\lst@identifierstyle \lsthk@Output}
757     \lst@InstallKeywords{kc}{keywordcomment}{}\relax{}
758     {\ifnum\lst@mode=\lst@KCmode
759     \edef\lst@temp{\the\lst@token}%
760     \ifx\lst@temp\lst@KCmatch
761     \lst@EndKC
762     \fi
763     \else
764     \lst@ifmode\else
765     \xdef\lst@KCmatch{\the\lst@token}%
766     \global\let\lst@KCpost\lst@BeginKC
767     \fi
768     \fi}
769     lo
770     \lst@Key{keywordcommentsemicolon}{}{\lstKV@ThreeArg{#1}%
771     {\def\lst@KCAkeywordsB{##1}%
772     \def\lst@KCAkeywordsE{##2}%
773     \def\lst@KCBkeywordsB{##3}%
774     \def\lst@KCkeywords{##1##2##3}}}
775     \lst@AddToHook{SetLanguage}{%
776     \let\lst@KCAkeywordsB\@empty \let\lst@KCAkeywordsE\@empty
777     \let\lst@KCBkeywordsB\@empty \let\lst@KCkeywords\@empty}
778     \lst@AddToHook{SelectCharTable}
779     {\ifx\lst@KCkeywords\@empty\else
780     \lst@DefSaveDef{`\;}\lsts@EKC
781     {\lst@XPrintToken
782     \ifnum\lst@mode=\lst@KCmode \lst@EndComment\@empty \else
783     \ifnum\lst@mode=\lst@KCSmode \lst@EndComment\@empty
784     \fi \fi
785     \lsts@EKC}%
786     \fi}
787     \gdef\lst@KCAWorkB{%
788     \lst@ifmode\else \global\let\lst@KCpost\lst@BeginKC \fi}
789     \gdef\lst@KCBWorkB{%
790     \lst@ifmode\else \global\let\lst@KCpost\lst@BeginKCS \fi}
791     \gdef\lst@KCAWorkE{\ifnum\lst@mode=\lst@KCmode \lst@EndKC \fi}
792     \lst@ProvideFamily@@
793     \lst@KCAkeywordsB@list\lst@KCAkeywordsB \lst@KC@also
794     \lst@gKCAkeywordsB@list\lst@gKCAkeywordsB \lst@KCAWorkB
795     {kcb}owo % prefix, other key, working procedure, Output hook
796     \lst@ProvideFamily@@
797     \lst@KCAkeywordsE@list\lst@KCAkeywordsE \lst@KC@also
798     \lst@gKCAkeywordsE@list\lst@gKCAkeywordsE \lst@KCAWorkE
799     {kce}owo
800     \lst@ProvideFamily@@
801     \lst@KCBkeywordsB@list\lst@KCBkeywordsB \lst@KC@also
802     \lst@gKCBkeywordsB@list\lst@gKCBkeywordsB \lst@KCBWorkB
803     {kcs}owo
804     \lst@EndAspect
805     \lst@BeginAspect[keywords]{index}
806     \lst@InstallFamily w{index}{indexstyle}\lstindexmacro{indexstyle}
807     {\csname\@lst @indexstyle#1\expandafter\endcsname
808     \expandafter{\the\lst@token}}
809     od
810     \lst@UserCommand\lstindexmacro#1{\index{{\ttfamily#1}}}
811     \lst@EndAspect
812     \lst@BeginAspect[keywords]{procnames}
813     \gdef\lst@procnametrue{\global\let\lst@ifprocname\iftrue}
814     \gdef\lst@procnamefalse{\global\let\lst@ifprocname\iffalse}
815     \lst@AddToHook{Init}{\lst@procnamefalse}
816     \lst@AddToHook{DetectKeywords}
817     {\lst@ifprocname
818     \let\lst@thestyle\lst@procnamestyle
819     \lst@ifindexproc \csname\@lst @gindex@sty\endcsname \fi
820     \lst@procnamefalse
821     \fi}
822     \lst@Key{procnamestyle}{}{\def\lst@procnamestyle{#1}}
823     \lst@Key{indexprocnames}{false}[t]{\lstKV@SetIf{#1}\lst@ifindexproc}
824     \lst@AddToHook{Init}{\lst@ifindexproc \lst@indexproc \fi}
825     \gdef\lst@indexproc{%
826     \@ifundefined{lst@indexstyle1}%
827     {\@namedef{lst@indexstyle1}##1{}}%
828     {}}
829     \lst@InstallKeywords w{procnamekeys}{}\relax{}
830     {\global\let\lst@PNpost\lst@procnametrue}
831     od
832     \lst@AddToHook{PostOutput}{\lst@PNpost\global\let\lst@PNpost\@empty}
833     \global\let\lst@PNpost\@empty % init
834     \lst@EndAspect
835     \lst@BeginAspect{style}
836     \@ifundefined{lststylefiles}
837     {\lst@UserCommand\lststylefiles{lststy0.sty}}{}
838     \lst@UserCommand\lstdefinestyle{\lst@DefStyle\iftrue}
839     \lst@UserCommand\lst@definestyle{\lst@DefStyle\iffalse}
840     \gdef\lst@DefStyle{\lst@DefDriver{style}{sty}\lstset}
841     \global\@namedef{lststy@$}{\lsthk@EmptyStyle}
842     \lst@AddToHook{EmptyStyle}{}% init
843     \lst@Key{style}\relax{%
844     \lst@LAS{style}{sty}{[]{#1}}\lst@NoAlias\lststylefiles
845     \lsthk@SetStyle
846     {}}
847     \lst@AddToHook{SetStyle}{}% init
848     \lst@EndAspect
849     \lst@BeginAspect{language}
850     \@ifundefined{lstdriverfiles}
851     {\lst@UserCommand\lstlanguagefiles{lstlang0.sty}}{}
852     \lst@UserCommand\lstdefinelanguage{\lst@DefLang\iftrue}
853     \lst@UserCommand\lst@definelanguage{\lst@DefLang\iffalse}
854     \gdef\lst@DefLang{\lst@DefDriver{language}{lang}\lstset}
855     \lstdefinelanguage{}{}
856     \lst@Key{language}\relax{\lstKV@OptArg[]{#1}%
857     {\lst@LAS{language}{lang}{[##1]{##2}}\lst@FindAlias\lstlanguagefiles
858     \lsthk@SetLanguage
859     {\lst@FindAlias[##1]{##2}%
860     \let\lst@language\lst@malias
861     \let\lst@dialect\lst@oalias}}}
862     \lst@Key{alsolanguage}\relax{\lstKV@OptArg[]{#1}%
863     {\lst@LAS{language}{lang}{[##1]{##2}}\lst@FindAlias\lstlanguagefiles
864     {}%
865     {\lst@FindAlias[##1]{##2}%
866     \let\lst@language\lst@malias
867     \let\lst@dialect\lst@oalias}}}
868     \lst@AddToHook{SetLanguage}{}% init
869     \lst@UserCommand\lstalias{\@ifnextchar[\lstalias@\lstalias@@}
870     \gdef\lstalias@[#1]#2[#3]#4{\lst@NormedNameDef{lsta@#2$#1}{#4$#3}}
871     \gdef\lstalias@@#1#2{\lst@NormedNameDef{lsta@#1}{#2}}
872     \lst@Key{defaultdialect}\relax
873     {\lstKV@OptArg[]{#1}{\lst@NormedNameDef{lstdd@##2}{##1}}}
874     \gdef\lst@FindAlias[#1]#2{%
875     \lst@NormedDef\lst@oalias{#1}%
876     \lst@NormedDef\lst@malias{#2}%
877     \@ifundefined{lsta@\lst@malias}{}%
878     {\edef\lst@malias{\csname\@lst a@\lst@malias\endcsname}}%
879     \ifx\@empty\lst@oalias \@ifundefined{lstdd@\lst@malias}{}%
880     {\edef\lst@oalias{\csname\@lst dd@\lst@malias\endcsname}}%
881     \fi
882     \edef\lst@temp{\lst@malias $\lst@oalias}%
883     \@ifundefined{lsta@\lst@temp}{}%
884     {\edef\lst@temp{\csname\@lst a@\lst@temp\endcsname}}%
885     \expandafter\lst@FindAlias@\lst@temp $}
886     \gdef\lst@FindAlias@#1$#2${%
887     \def\lst@malias{#1}\def\lst@oalias{#2}%
888     \ifx\@empty\lst@oalias \@ifundefined{lstdd@\lst@malias}{}%
889     {\edef\lst@oalias{\csname\@lst dd@\lst@malias\endcsname}}%
890     \fi}
891     \gdef\lst@RequireLanguages#1{%
892     \lst@Require{language}{lang}{#1}\lst@FindAlias\lstlanguagefiles
893     \ifx\lst@loadaspects\@empty\else
894     \lst@RequireAspects\lst@loadaspects
895     \fi}
896     \global\let\lstloadlanguages\lst@RequireLanguages
897     \lst@EndAspect
898     \lst@BeginAspect{formats}
899     \@ifundefined{lstformatfiles}
900     {\lst@UserCommand\lstformatfiles{lstfmt0.sty}}{}
901     \lst@UserCommand\lstdefineformat{\lst@DefFormat\iftrue}
902     \lst@UserCommand\lst@defineformat{\lst@DefFormat\iffalse}
903     \gdef\lst@DefFormat{\lst@DefDriver{format}{fmt}\lst@UseFormat}
904     \lstdefineformat{}{}
905     \lst@Key{format}\relax{%
906     \lst@LAS{format}{fmt}{[]{#1}}\lst@NoAlias\lstformatfiles
907     \lsthk@SetFormat
908     {}}
909     \lst@AddToHook{SetFormat}{\let\lst@fmtformat\@empty}% init
910     \gdef\lst@fmtSplit#1#2{%
911     \def\lst@temp##1#2##2\relax##3{%
912     \ifnum##3=\z@
913     \ifx\@empty##2\@empty
914     \lst@false
915     \let\lst@fmta#1%
916     \let\lst@fmtb\@empty
917     \else
918     \expandafter\lst@temp#1\relax\@ne
919     \fi
920     \else
921     \def\lst@fmta{##1}\def\lst@fmtb{##2}%
922     \fi}%
923     \lst@true
924     \expandafter\lst@temp#1#2\relax\z@}
925     \gdef\lst@IfNextCharWhitespace#1#2#3{%
926     \lst@IfSubstring#3\lst@whitespaces{#1}{#2}#3}
927     \begingroup
928     \catcode`\^^I=12\catcode`\^^J=12\catcode`\^^M=12\catcode`\^^L=12\relax%
929     \lst@DefActive\lst@whitespaces{\ ^^I^^J^^M}% add ^^L
930     \global\let\lst@whitespaces\lst@whitespaces%
931     \endgroup
932     \gdef\lst@fmtIfIdentifier#1{%
933     \ifx\relax#1\@empty
934     \expandafter\@secondoftwo
935     \else
936     \expandafter\lst@fmtIfIdentifier@\expandafter#1%
937     \fi}
938     \gdef\lst@fmtIfIdentifier@#1#2\relax{%
939     \let\lst@next\@secondoftwo
940     \ifnum`#1=`_\else
941     \ifnum`#1<64\else
942     \ifnum`#1<91\let\lst@next\@firstoftwo\else
943     \ifnum`#1<97\else
944     \ifnum`#1<123\let\lst@next\@firstoftwo\else
945     \fi \fi \fi \fi \fi
946     \lst@next}
947     \gdef\lst@fmtIfNextCharIn#1{%
948     \ifx\@empty#1\@empty \expandafter\@secondoftwo \else
949     \def\lst@next{\lst@fmtIfNextCharIn@{#1}}%
950     \expandafter\lst@next\fi}
951     \gdef\lst@fmtIfNextCharIn@#1#2#3#4{%
952     \def\lst@temp##1#4##2##3\relax{%
953     \ifx \@empty##2\expandafter\@secondoftwo
954     \else \expandafter\@firstoftwo \fi}%
955     \lst@temp#1#4\@empty\relax{#2}{#3}#4}
956     \gdef\lst@fmtCDef#1{\lst@fmtCDef@#1}
957     \gdef\lst@fmtCDef@#1#2#3#4#5#6#7{%
958     \lst@CDefIt#1{#2}{#3}%
959     {\lst@fmtIfNextCharIn{#5}{#4#2#3}{#6#4#2#3#7}}%
960     #4%
961     {}{}{}}
962     \gdef\lst@fmtCDefX#1{\lst@fmtCDefX@#1}
963     \gdef\lst@fmtCDefX@#1#2#3#4#5#6#7{%
964     \let#4#1%
965     \ifx\@empty#2\@empty
966     \def#1{\lst@fmtIfNextCharIn{#5}{#4}{#6#7}}%
967     \else \ifx\@empty#3\@empty
968     \def#1##1{%
969     \ifx##1#2%
970     \def\lst@next{\lst@fmtIfNextCharIn{#5}{#4##1}%
971     {#6#7}}%
972     \else
973     \def\lst@next{#4##1}%
974     \fi
975     \lst@next}%
976     \else
977     \def#1{%
978     \lst@IfNextCharsArg{#2#3}%
979     {\lst@fmtIfNextCharIn{#5}{\expandafter#4\lst@eaten}%
980     {#6#7}}%
981     {\expandafter#4\lst@eaten}}%
982     \fi \fi}
983     \gdef\lst@UseFormat#1{%
984     \def\lst@fmtwhole{#1}%
985     \lst@UseFormat@}
986     \gdef\lst@UseFormat@{%
987     \lst@fmtSplit\lst@fmtwhole,%
988     \let\lst@fmtwhole\lst@fmtb
989     \ifx\lst@fmta\@empty\else
990     \lst@fmtSplit\lst@fmta=%
991     \ifx\@empty\lst@fmta\else
992     \expandafter\lstKV@XOptArg\expandafter[\expandafter]%
993     \expandafter{\lst@fmtb}\lst@UseFormat@b
994     \fi
995     \fi
996     \ifx\lst@fmtwhole\@empty\else
997     \expandafter\lst@UseFormat@
998     \fi}
999     \gdef\lst@UseFormat@b[#1]#2{%
1000     \def\lst@fmtc{{#1}}\lst@lExtend\lst@fmtc{\expandafter{\lst@fmta}}%
1001     \def\lst@fmtb{#2}%
1002     \lst@fmtSplit\lst@fmtb\string
1003     \ifx\@empty\lst@fmta
1004     \lst@lAddTo\lst@fmtc{{}}%
1005     \else
1006     \lst@lExtend\lst@fmtc{\expandafter
1007     {\expandafter\lst@fmtPre\expandafter{\lst@fmta}}}%
1008     \fi
1009     \ifx\@empty\lst@fmtb
1010     \lst@lAddTo\lst@fmtc{{}}%
1011     \else
1012     \lst@lExtend\lst@fmtc{\expandafter
1013     {\expandafter\lst@fmtPost\expandafter{\lst@fmtb}}}%
1014     \fi
1015     \expandafter\lst@UseFormat@c\lst@fmtc}
1016     \gdef\lst@UseFormat@c#1#2#3#4{%
1017     \lst@fmtIfIdentifier#2\relax
1018     {\lst@fmtIdentifier{#2}%
1019     \lst@if\else \PackageWarning{Listings}%
1020     {Cannot drop identifier in format definition}%
1021     \fi}%
1022     {\lst@if
1023     \lst@lAddTo\lst@fmtformat{\lst@CArgX#2\relax\lst@fmtCDef}%
1024     \else
1025     \lst@lAddTo\lst@fmtformat{\lst@CArgX#2\relax\lst@fmtCDefX}%
1026     \fi
1027     \lst@DefActive\lst@fmtc{#1}%
1028     \lst@lExtend\lst@fmtformat{\expandafter{\lst@fmtc}{#3}{#4}}}}
1029     \lst@AddToHook{SelectCharTable}{\lst@fmtformat}
1030     \global\let\lst@fmtformat\@empty
1031     \gdef\lst@fmtPre#1{%
1032     \lst@PrintToken
1033     \begingroup
1034     \let\newline\lst@fmtEnsureNewLine
1035     \let\space\lst@fmtEnsureSpace
1036     \let\indent\lst@fmtIndent
1037     \let\noindent\lst@fmtNoindent
1038     #1%
1039     \endgroup}
1040     \gdef\lst@fmtPost#1{%
1041     \global\let\lst@fmtPostOutput\@empty
1042     \begingroup
1043     \def\newline{\lst@AddTo\lst@fmtPostOutput\lst@fmtEnsureNewLine}%
1044     \def\space{\aftergroup\lst@fmtEnsurePostSpace}%
1045     \def\indent{\lst@AddTo\lst@fmtPostOutput\lst@fmtIndent}%
1046     \def\noindent{\lst@AddTo\lst@fmtPostOutput\lst@fmtNoindent}%
1047     \aftergroup\lst@PrintToken
1048     #1%
1049     \endgroup}
1050     \lst@AddToHook{Init}{\global\let\lst@fmtPostOutput\@empty}
1051     \lst@AddToHook{PostOutput}
1052     {\lst@fmtPostOutput \global\let\lst@fmtPostOutput\@empty}
1053     \gdef\lst@fmtEnsureSpace{%
1054     \lst@ifwhitespace\else \expandafter\lst@ProcessSpace \fi}
1055     \gdef\lst@fmtEnsurePostSpace{%
1056     \lst@IfNextCharWhitespace{}{\lst@ProcessSpace}}
1057     \lst@Key{fmtindent}{20pt}{\def\lst@fmtindent{#1}}
1058     \newdimen\lst@fmtcurrindent
1059     \lst@AddToHook{InitVars}{\global\lst@fmtcurrindent\z@}
1060     \gdef\lst@fmtIndent{\global\advance\lst@fmtcurrindent\lst@fmtindent}
1061     \gdef\lst@fmtNoindent{\global\advance\lst@fmtcurrindent-\lst@fmtindent}
1062     \gdef\lst@fmtEnsureNewLine{%
1063     \global\advance\lst@newlines\@ne
1064     \global\advance\lst@newlinesensured\@ne
1065     \lst@fmtignoretrue}
1066     \lst@AddToAtTop\lst@DoNewLines{%
1067     \ifnum\lst@newlines>\lst@newlinesensured
1068     \global\advance\lst@newlines-\lst@newlinesensured
1069     \fi
1070     \global\lst@newlinesensured\z@}
1071     \newcount\lst@newlinesensured % global
1072     \lst@AddToHook{Init}{\global\lst@newlinesensured\z@}
1073     \gdef\lst@fmtignoretrue{\let\lst@fmtifignore\iftrue}
1074     \gdef\lst@fmtignorefalse{\let\lst@fmtifignore\iffalse}
1075     \lst@AddToHook{InitVars}{\lst@fmtignorefalse}
1076     \lst@AddToHook{Output}{\lst@fmtignorefalse}
1077     \gdef\lst@fmtUseLostSpace{%
1078     \lst@ifnewline \kern\lst@fmtcurrindent \global\lst@lostspace\z@
1079     \else
1080     \lst@OldOLS
1081     \fi}
1082     \lst@AddToHook{Init}
1083     {\lst@true
1084     \ifx\lst@fmtformat\@empty \ifx\lst@fmt\@empty \lst@false \fi\fi
1085     \lst@if
1086     \let\lst@OldOLS\lst@OutputLostSpace
1087     \let\lst@OutputLostSpace\lst@fmtUseLostSpace
1088     \let\lst@ProcessSpace\lst@fmtProcessSpace
1089     \fi}
1090     \gdef\lst@fmtProcessSpace{%
1091     \lst@ifletter
1092     \lst@Output
1093     \lst@fmtifignore\else
1094     \lst@AppendOther\lst@outputspace
1095     \fi
1096     \else \lst@ifkeepspaces
1097     \lst@AppendOther\lst@outputspace
1098     \else \ifnum\lst@newlines=\z@
1099     \lst@AppendSpecialSpace
1100     \else \ifnum\lst@length=\z@
1101     \global\advance\lst@lostspace\lst@width
1102     \global\advance\lst@pos\m@ne
1103     \else
1104     \lst@AppendSpecialSpace
1105     \fi
1106     \fi \fi \fi
1107     \lst@whitespacetrue}
1108     \lst@InstallTest{f}
1109     \lst@fmt@list\lst@fmt \lst@gfmt@list\lst@gfmt
1110     \lst@gfmt@wp
1111     wd
1112     \gdef\lst@fmt@list{\lst@fmt\lst@gfmt}\global\let\lst@fmt\@empty
1113     \gdef\lst@gfmt@list{\lst@fmt\lst@gfmt}\global\let\lst@gfmt\@empty
1114     \gdef\lst@gfmt@wp{%
1115     \begingroup \let\lst@UM\@empty
1116     \let\lst@PrintToken\@empty
1117     \csname\lst@ @fmt$\the\lst@token\endcsname
1118     \endgroup}
1119     \gdef\lst@fmtIdentifier#1#2#3#4{%
1120     \lst@DefOther\lst@fmta{#2}\edef\lst@fmt{\lst@fmt,\lst@fmta}%
1121     \@namedef{\lst@ @fmt$\lst@fmta}{#3#4}}
1122     \lst@EndAspect
1123     \lst@BeginAspect{labels}
1124     \lst@Key{numbers}{none}{%
1125     \let\lst@PlaceNumber\@empty
1126     \lstKV@SwitchCases{#1}%
1127     {none&\\%
1128     left&\def\lst@PlaceNumber{\llap{\normalfont
1129     \lst@numberstyle{\thelstnumber}\kern\lst@numbersep}}\\%
1130     right&\def\lst@PlaceNumber{\rlap{\normalfont
1131     \kern\linewidth \kern\lst@numbersep
1132     \lst@numberstyle{\thelstnumber}}}%
1133     }{\PackageError{Listings}{Numbers #1 unknown}\@ehc}}
1134     \lst@Key{numberstyle}{}{\def\lst@numberstyle{#1}}
1135     \lst@Key{numbersep}{10pt}{\def\lst@numbersep{#1}}
1136     \lst@Key{stepnumber}{1}{\def\lst@stepnumber{#1\relax}}
1137     \lst@AddToHook{EmptyStyle}{\let\lst@stepnumber\@ne}
1138     \lst@Key{numberblanklines}{true}[t]
1139     {\lstKV@SetIf{#1}\lst@ifnumberblanklines}
1140     \lst@Key{numberfirstline}{f}[t]{\lstKV@SetIf{#1}\lst@ifnumberfirstline}
1141     \gdef\lst@numberfirstlinefalse{\let\lst@ifnumberfirstline\iffalse}
1142     \lst@Key{firstnumber}{auto}{%
1143     \lstKV@SwitchCases{#1}%
1144     {auto&\let\lst@firstnumber\@undefined\\%
1145     last&\let\lst@firstnumber\c@lstnumber
1146     }{\def\lst@firstnumber{#1\relax}}}
1147     \lst@AddToHook{PreSet}{\let\lst@advancenumber\z@}
1148     \lst@AddToHook{PreInit}
1149     {\ifx\lst@firstnumber\@undefined
1150     \let\lst@firstnumber\lst@firstline
1151     \fi}
1152     \gdef\lst@SetFirstNumber{%
1153     \ifx\lst@firstnumber\@undefined
1154     \@tempcnta 0\csname\@lst no@\lst@intname\endcsname\relax
1155     \ifnum\@tempcnta=\z@ \@tempcnta\lst@firstline
1156     \else \lst@nololtrue \fi
1157     \advance\@tempcnta\lst@advancenumber
1158     \edef\lst@firstnumber{\the\@tempcnta\relax}%
1159     \fi}
1160     \gdef\lst@SaveFirstNumber{%
1161     \expandafter\xdef
1162     \csname\@lst no\ifx\lst@intname\@empty @ \else @\lst@intname\fi
1163     \endcsname{\the\c@lstnumber}}
1164     \newcounter{lstnumber}% \global
1165     \global\c@lstnumber\@ne % init
1166     \renewcommand*\thelstnumber{\@arabic\c@lstnumber}
1167     \lst@AddToHook{EveryPar}
1168     {\global\advance\c@lstnumber\lst@advancelstnum
1169     \global\advance\c@lstnumber\m@ne \refstepcounter{lstnumber}%
1170     \lst@SkipOrPrintLabel}%
1171     \global\let\lst@advancelstnum\@ne
1172     \lst@AddToHook{Init}{\def\@currentlabel{\thelstnumber}}
1173     \lst@AddToHook{InitVars}
1174     {\global\c@lstnumber\lst@firstnumber
1175     \global\advance\c@lstnumber\lst@advancenumber
1176     \global\advance\c@lstnumber-\lst@advancelstnum
1177     \ifx \lst@firstnumber\c@lstnumber
1178     \global\advance\c@lstnumber-\lst@advancelstnum
1179     \fi}
1180     \lst@AddToHook{ExitVars}
1181     {\global\advance\c@lstnumber\lst@advancelstnum}
1182     \AtBeginDocument{%
1183     \def\theHlstnumber{\ifx\lst@@caption\@empty \lst@neglisting
1184     \else \thelstlisting \fi
1185     .\thelstnumber}}
1186     \newcount\lst@skipnumbers % \global
1187     \lst@AddToHook{Init}
1188     {\ifnum \z@>\lst@stepnumber
1189     \let\lst@advancelstnum\m@ne
1190     \edef\lst@stepnumber{-\lst@stepnumber}%
1191     \fi
1192     \ifnum \z@<\lst@stepnumber
1193     \global\lst@skipnumbers\lst@firstnumber
1194     \global\divide\lst@skipnumbers\lst@stepnumber
1195     \global\multiply\lst@skipnumbers-\lst@stepnumber
1196     \global\advance\lst@skipnumbers\lst@firstnumber
1197     \ifnum\lst@skipnumbers>\z@
1198     \global\advance\lst@skipnumbers -\lst@stepnumber
1199     \fi
1200     \else
1201     \let\lst@SkipOrPrintLabel\relax
1202     \fi}
1203     \gdef\lst@SkipOrPrintLabel{%
1204     \ifnum\lst@skipnumbers=\z@
1205     \global\advance\lst@skipnumbers-\lst@stepnumber\relax
1206     \lst@PlaceNumber
1207     \lst@numberfirstlinefalse
1208     \else
1209     \lst@ifnumberfirstline
1210     \lst@PlaceNumber
1211     \lst@numberfirstlinefalse
1212     \fi
1213     \fi
1214     \global\advance\lst@skipnumbers\@ne}%
1215     \lst@AddToHook{OnEmptyLine}{%
1216     \lst@ifnumberblanklines\else \ifnum\lst@skipnumbers=\z@
1217     \global\advance\lst@skipnumbers-\lst@stepnumber\relax
1218     \fi\fi}
1219     \lst@EndAspect
1220     \lst@BeginAspect{lineshape}
1221     \lst@Key{xleftmargin}{\z@}{\def\lst@xleftmargin{#1}}
1222     \lst@Key{xrightmargin}{\z@}{\def\lst@xrightmargin{#1}}
1223     \lst@Key{resetmargins}{false}[t]{\lstKV@SetIf{#1}\lst@ifresetmargins}
1224     \lst@AddToHook{BoxUnsafe}{\let\lst@xleftmargin\z@
1225     \let\lst@xrightmargin\z@}
1226     \lst@AddToHook{TextStyle}{%
1227     \let\lst@xleftmargin\z@ \let\lst@xrightmargin\z@
1228     \let\lst@ifresetmargins\iftrue}
1229     \lst@Key{linewidth}\linewidth{\def\lst@linewidth{#1}}
1230     \lst@AddToHook{PreInit}{\linewidth\lst@linewidth\relax}
1231     \gdef\lst@parshape{%
1232     \parshape\@ne \@totalleftmargin \linewidth}
1233     \lst@AddToHook{Init}
1234     {\lst@ifresetmargins
1235     \advance\linewidth\@totalleftmargin
1236     \advance\linewidth\rightmargin
1237     \@totalleftmargin\z@
1238     \fi
1239     \advance\linewidth-\lst@xleftmargin
1240     \advance\linewidth-\lst@xrightmargin
1241     \advance\@totalleftmargin\lst@xleftmargin\relax}
1242     \lst@Key{lineskip}{\z@}{\def\lst@lineskip{#1\relax}}
1243     \lst@AddToHook{Init}
1244     {\parskip\z@
1245     \ifdim\z@=\lst@lineskip\else
1246     \@tempdima\baselineskip
1247     \advance\@tempdima\lst@lineskip
1248     \multiply\@tempdima\@cclvi
1249     \divide\@tempdima\baselineskip\relax
1250     \multiply\@tempdima\@cclvi
1251     \edef\baselinestretch{\strip@pt\@tempdima}%
1252     \selectfont
1253     \fi}
1254     \lst@Key{breaklines}{false}[t]{\lstKV@SetIf{#1}\lst@ifbreaklines}
1255     \lst@Key{breakindent}{20pt}{\def\lst@breakindent{#1}}
1256     \lst@Key{breakautoindent}{t}[t]{\lstKV@SetIf{#1}\lst@ifbreakautoindent}
1257     \lst@Key{prebreak}{}{\def\lst@prebreak{#1}}
1258     \lst@Key{postbreak}{}{\def\lst@postbreak{#1}}
1259     \lst@AddToHook{Init}
1260     {\lst@ifbreaklines
1261     \hbadness\@M \pretolerance\@M
1262     \def\lst@parshape{\parshape\tw@ \@totalleftmargin\linewidth
1263     \lst@breakshape}%
1264     \else
1265     \let\lst@discretionary\@empty
1266     \fi}
1267     \lst@AddToHook{OnNewLine}
1268     {\lst@ifbreaklines \lst@breakNewLine \fi}
1269     \gdef\lst@discretionary{%
1270     \discretionary{\let\space\lst@spacekern\lst@prebreak}%
1271     {\llap{\lsthk@EveryLine
1272     \kern\lst@breakcurrindent \kern-\@totalleftmargin}%
1273     \let\space\lst@spacekern\lst@postbreak}{}}
1274     \lst@AddToHook{PostOutput}{\lst@discretionary}
1275     \gdef\lst@spacekern{\kern\lst@width}
1276     \gdef\lst@breakNewLine{%
1277     \@tempdima\lst@breakindent\relax
1278     \lst@ifbreakautoindent \advance\@tempdima\lst@lostspace \fi
1279     \@tempdimc-\@tempdima \advance\@tempdimc\linewidth
1280     \advance\@tempdima\@totalleftmargin
1281     \xdef\lst@breakshape{\noexpand\lst@breakcurrindent \the\@tempdimc}%
1282     \xdef\lst@breakcurrindent{\the\@tempdima}}
1283     \global\let\lst@breakcurrindent\z@ % init
1284     \gdef\lst@breakshape{\@totalleftmargin \linewidth}
1285     \gdef\lst@breakProcessOther#1{\lst@ProcessOther#1\lst@OutputOther}
1286     \lst@AddToHook{SelectCharTable}
1287     {\lst@ifbreaklines \lst@Def{`)}{\lst@breakProcessOther)}\fi}
1288     \lst@EndAspect
1289     \lst@BeginAspect[lineshape]{frames}
1290     \lst@Key{framexleftmargin}{\z@}{\def\lst@framexleftmargin{#1}}
1291     \lst@Key{framexrightmargin}{\z@}{\def\lst@framexrightmargin{#1}}
1292     \lst@Key{framextopmargin}{\z@}{\def\lst@framextopmargin{#1}}
1293     \lst@Key{framexbottommargin}{\z@}{\def\lst@framexbottommargin{#1}}
1294     \lst@Key{backgroundcolor}{}{\def\lst@bkgcolor{#1}}
1295     \lst@Key{fillcolor}{}{\def\lst@fillcolor{#1}}
1296     \lst@Key{rulecolor}{}{\def\lst@rulecolor{#1}}
1297     \lst@Key{rulesepcolor}{}{\def\lst@rulesepcolor{#1}}
1298     \lst@AddToHook{Init}{%
1299     \ifx\lst@fillcolor\@empty
1300     \let\lst@fillcolor\lst@bkgcolor
1301     \fi
1302     \ifx\lst@rulesepcolor\@empty
1303     \let\lst@rulesepcolor\lst@fillcolor
1304     \fi}
1305     \lst@Key{rulesep}{2pt}{\def\lst@rulesep{#1}}
1306     \lst@Key{framerule}{.4pt}{\def\lst@framerulewidth{#1}}
1307     \lst@Key{framesep}{3pt}{\def\lst@frametextsep{#1}}
1308     \lst@Key{frameshape}{}{%
1309     \let\lst@xrulecolor\@empty
1310     \lstKV@FourArg{#1}%
1311     {\uppercase{\def\lst@frametshape{##1}}%
1312     \uppercase{\def\lst@framelshape{##2}}%
1313     \uppercase{\def\lst@framershape{##3}}%
1314     \uppercase{\def\lst@framebshape{##4}}%
1315     \let\lst@ifframeround\iffalse
1316     \lst@IfSubstring R\lst@frametshape{\let\lst@ifframeround\iftrue}{}%
1317     \lst@IfSubstring R\lst@framebshape{\let\lst@ifframeround\iftrue}{}%
1318     \def\lst@frame{##1##2##3##4}}}
1319     \lst@Key{frameround}\relax
1320     {\uppercase{\def\lst@frameround{#1}}%
1321     \expandafter\lstframe@\lst@frameround ffff\relax}
1322     \global\let\lst@frameround\@empty
1323     \lst@Key{frame}\relax{%
1324     \let\lst@xrulecolor\@empty
1325     \lstKV@SwitchCases{#1}%
1326     {none&\let\lst@frame\@empty\\%
1327     leftline&\def\lst@frame{l}\\%
1328     topline&\def\lst@frame{t}\\%
1329     bottomline&\def\lst@frame{b}\\%
1330     lines&\def\lst@frame{tb}\\%
1331     single&\def\lst@frame{trbl}\\%
1332     shadowbox&\def\lst@frame{tRBl}%
1333     \def\lst@xrulecolor{\lst@rulesepcolor}%
1334     \def\lst@rulesep{\lst@frametextsep}%
1335     }{\def\lst@frame{#1}}%
1336     \expandafter\lstframe@\lst@frameround ffff\relax}
1337     \gdef\lstframe@#1#2#3#4#5\relax{%
1338     \lst@IfSubstring T\lst@frame{\edef\lst@frame{t\lst@frame}}{}%
1339     \lst@IfSubstring R\lst@frame{\edef\lst@frame{r\lst@frame}}{}%
1340     \lst@IfSubstring B\lst@frame{\edef\lst@frame{b\lst@frame}}{}%
1341     \lst@IfSubstring L\lst@frame{\edef\lst@frame{l\lst@frame}}{}%
1342     \let\lst@frametshape\@empty \let\lst@framebshape\@empty
1343     \lst@frameCheck
1344     ltr\lst@framelshape\lst@frametshape\lst@framershape #4#1%
1345     \lst@frameCheck
1346     LTR\lst@framelshape\lst@frametshape\lst@framershape #4#1%
1347     \lst@frameCheck
1348     lbr\lst@framelshape\lst@framebshape\lst@framershape #3#2%
1349     \lst@frameCheck
1350     LBR\lst@framelshape\lst@framebshape\lst@framershape #3#2%
1351     \let\lst@ifframeround\iffalse
1352     \lst@IfSubstring R\lst@frametshape{\let\lst@ifframeround\iftrue}{}%
1353     \lst@IfSubstring R\lst@framebshape{\let\lst@ifframeround\iftrue}{}%
1354     \let\lst@framelshape\@empty \let\lst@framershape\@empty
1355     \lst@IfSubstring L\lst@frame
1356     {\def\lst@framelshape{YY}}%
1357     {\lst@IfSubstring l\lst@frame{\def\lst@framelshape{Y}}{}}%
1358     \lst@IfSubstring R\lst@frame
1359     {\def\lst@framershape{YY}}%
1360     {\lst@IfSubstring r\lst@frame{\def\lst@framershape{Y}}{}}}
1361     \gdef\lst@frameCheck#1#2#3#4#5#6#7#8{%
1362     \lst@IfSubstring #1\lst@frame
1363     {\if #7T\def#4{R}\else \def#4{Y}\fi}%
1364     {\def#4{N}}%
1365     \lst@IfSubstring #3\lst@frame
1366     {\if #8T\def#6{R}\else \def#6{Y}\fi}%
1367     {\def#6{N}}%
1368     \lst@IfSubstring #2\lst@frame{\edef#5{#5#4Y#6}}{}}
1369     \lst@AddToHook{TextStyle}
1370     {\let\lst@frame\@empty
1371     \let\lst@frametshape\@empty
1372     \let\lst@framershape\@empty
1373     \let\lst@framebshape\@empty
1374     \let\lst@framelshape\@empty}
1375     \gdef\lst@frameMakeBoxV#1#2#3{%
1376     \setbox#1\hbox{%
1377     \color@begingroup \lst@rulecolor
1378     \llap{\setbox\z@\hbox{\vrule\@width\z@\@height#2\@depth#3%
1379     \lst@frameL}%
1380     \rlap{\lst@frameBlock\lst@rulesepcolor{\wd\z@}%
1381     {\ht\z@}{\dp\z@}}%
1382     \box\z@
1383     \ifx\lst@framelshape\@empty
1384     \kern\lst@frametextsep\relax
1385     \else
1386     \lst@frameBlock\lst@fillcolor\lst@frametextsep{#2}{#3}%
1387     \fi
1388     \kern\lst@framexleftmargin}%
1389     \rlap{\kern-\lst@framexleftmargin
1390     \@tempdima\linewidth
1391     \advance\@tempdima\lst@framexleftmargin
1392     \advance\@tempdima\lst@framexrightmargin
1393     \lst@frameBlock\lst@bkgcolor\@tempdima{#2}{#3}%
1394     \ifx\lst@framershape\@empty
1395     \kern\lst@frametextsep\relax
1396     \else
1397     \lst@frameBlock\lst@fillcolor\lst@frametextsep{#2}{#3}%
1398     \fi
1399     \setbox\z@\hbox{\vrule\@width\z@\@height#2\@depth#3%
1400     \lst@frameR}%
1401     \rlap{\lst@frameBlock\lst@rulesepcolor{\wd\z@}%
1402     {\ht\z@}{\dp\z@}}%
1403     \box\z@}%
1404     \color@endgroup}}
1405     \gdef\lst@frameBlock#1#2#3#4{%
1406     \color@begingroup
1407     #1%
1408     \setbox\z@\hbox{\vrule\@height#3\@depth#4%
1409     \ifx#1\@empty \@width\z@ \kern#2\relax
1410     \else \@width#2\relax \fi}%
1411     \box\z@
1412     \color@endgroup}
1413     \gdef\lst@frameR{%
1414     \expandafter\lst@frameR@\lst@framershape\relax
1415     \kern-\lst@rulesep}
1416     \gdef\lst@frameR@#1{%
1417     \ifx\relax#1\@empty\else
1418     \if #1Y\lst@framevrule \else \kern\lst@framerulewidth \fi
1419     \kern\lst@rulesep
1420     \expandafter\lst@frameR@b
1421     \fi}
1422     \gdef\lst@frameR@b#1{%
1423     \ifx\relax#1\@empty
1424     \else
1425     \if #1Y\color@begingroup
1426     \lst@xrulecolor
1427     \lst@framevrule
1428     \color@endgroup
1429     \else
1430     \kern\lst@framerulewidth
1431     \fi
1432     \kern\lst@rulesep
1433     \expandafter\lst@frameR@
1434     \fi}
1435     \gdef\lst@frameL{%
1436     \kern-\lst@rulesep
1437     \expandafter\lst@frameL@\lst@framelshape\relax}
1438     \gdef\lst@frameL@#1{%
1439     \ifx\relax#1\@empty\else
1440     \kern\lst@rulesep
1441     \if#1Y\lst@framevrule \else \kern\lst@framerulewidth \fi
1442     \expandafter\lst@frameL@
1443     \fi}
1444     \gdef\lst@frameH#1#2{%
1445     \global\let\lst@framediml\z@ \global\let\lst@framedimr\z@
1446     \setbox\z@\hbox{}\@tempcntb\z@
1447     \expandafter\lst@frameH@\expandafter#1#2\relax\relax\relax
1448     \@tempdimb\lst@frametextsep\relax
1449     \advance\@tempdimb\lst@framerulewidth\relax
1450     \@tempdimc-\@tempdimb
1451     \advance\@tempdimc\ht\z@
1452     \advance\@tempdimc\dp\z@
1453     \setbox\z@=\hbox{%
1454     \lst@frameHBkg\lst@fillcolor\@tempdimb\@firstoftwo
1455     \if#1T\rlap{\raise\dp\@tempboxa\box\@tempboxa}%
1456     \else\rlap{\lower\ht\@tempboxa\box\@tempboxa}\fi
1457     \lst@frameHBkg\lst@rulesepcolor\@tempdimc\@secondoftwo
1458     \advance\@tempdimb\ht\@tempboxa
1459     \if#1T\rlap{\raise\lst@frametextsep\box\@tempboxa}%
1460     \else\rlap{\lower\@tempdimb\box\@tempboxa}\fi
1461     \rlap{\box\z@}%
1462     }}
1463     \gdef\lst@frameH@#1#2#3#4{%
1464     \ifx\relax#4\@empty\else
1465     \lst@frameh \@tempcntb#1#2#3#4%
1466     \advance\@tempcntb\@ne
1467     \expandafter\lst@frameH@\expandafter#1%
1468     \fi}
1469     \gdef\lst@frameHBkg#1#2#3{%
1470     \setbox\@tempboxa\hbox{%
1471     \kern-\lst@framexleftmargin
1472     #3{\kern-\lst@framediml\relax}{\@tempdima\z@}%
1473     \ifdim\lst@framediml>\@tempdimb
1474     #3{\@tempdima\lst@framediml \advance\@tempdima-\@tempdimb
1475     \lst@frameBlock\lst@rulesepcolor\@tempdima\@tempdimb\z@}%
1476     {\kern-\lst@framediml
1477     \advance\@tempdima\lst@framediml\relax}%
1478     \fi
1479     #3{\@tempdima\z@
1480     \ifx\lst@framelshape\@empty\else
1481     \advance\@tempdima\@tempdimb
1482     \fi
1483     \ifx\lst@framershape\@empty\else
1484     \advance\@tempdima\@tempdimb
1485     \fi}%
1486     {\ifdim\lst@framedimr>\@tempdimb
1487     \advance\@tempdima\lst@framedimr\relax
1488     \fi}%
1489     \advance\@tempdima\linewidth
1490     \advance\@tempdima\lst@framexleftmargin
1491     \advance\@tempdima\lst@framexrightmargin
1492     \lst@frameBlock#1\@tempdima#2\z@
1493     #3{\ifdim\lst@framedimr>\@tempdimb
1494     \@tempdima-\@tempdimb
1495     \advance\@tempdima\lst@framedimr\relax
1496     \lst@frameBlock\lst@rulesepcolor\@tempdima\@tempdimb\z@
1497     \fi}{}%
1498     }}
1499     \gdef\lst@frameh#1#2#3#4#5{%
1500     \lst@frameCalcDimA#1%
1501     \lst@ifframeround \@getcirc\@tempdima \fi
1502     \setbox\z@\hbox{%
1503     \begingroup
1504     \setbox\z@\hbox{%
1505     \kern-\lst@framexleftmargin
1506     \color@begingroup
1507     \ifnum#1=\z@ \lst@rulecolor \else \lst@xrulecolor \fi
1508     \lst@frameCornerX\llap{#2L}#3#1%
1509     \ifdim\lst@framediml<\@tempdimb
1510     \xdef\lst@framediml{\the\@tempdimb}%
1511     \fi
1512     \begingroup
1513     \if#4Y\else \let\lst@framerulewidth\z@ \fi
1514     \@tempdima\lst@framexleftmargin
1515     \advance\@tempdima\lst@framexrightmargin
1516     \advance\@tempdima\linewidth
1517     \vrule\@width\@tempdima\@height\lst@framerulewidth \@depth\z@
1518     \endgroup
1519     \lst@frameCornerX\rlap{#2R}#5#1%
1520     \ifdim\lst@framedimr<\@tempdimb
1521     \xdef\lst@framedimr{\the\@tempdimb}%
1522     \fi
1523     \color@endgroup}%
1524     \if#2T\rlap{\raise\dp\z@\box\z@}%
1525     \else\rlap{\lower\ht\z@\box\z@}\fi
1526     \endgroup
1527     \box\z@}}
1528     \gdef\lst@frameCornerX#1#2#3#4{%
1529     \setbox\@tempboxa\hbox{\csname\@lst @frame\if#3RR\fi #2\endcsname}%
1530     \@tempdimb\wd\@tempboxa
1531     \if #3R%
1532     #1{\box\@tempboxa}%
1533     \else
1534     \if #3Y\expandafter#1\else
1535     \@tempdimb\z@ \expandafter\vphantom \fi
1536     {\box\@tempboxa}%
1537     \fi}
1538     \gdef\lst@frameCalcDimA#1{%
1539     \@tempdima\lst@rulesep
1540     \advance\@tempdima\lst@framerulewidth
1541     \multiply\@tempdima#1\relax
1542     \advance\@tempdima\lst@frametextsep
1543     \advance\@tempdima\lst@framerulewidth
1544     \multiply\@tempdima\tw@}
1545     \lst@AddToHook{Init}{\lst@frameInit}
1546     \newbox\lst@framebox
1547     \gdef\lst@frameInit{%
1548     \ifx\lst@framelshape\@empty \let\lst@frameL\@empty \fi
1549     \ifx\lst@framershape\@empty \let\lst@frameR\@empty \fi
1550     \def\lst@framevrule{\vrule\@width\lst@framerulewidth\relax}%
1551     \lst@ifframeround
1552     \lst@frameCalcDimA\z@ \@getcirc\@tempdima
1553     \@tempdimb\@tempdima \divide\@tempdimb\tw@
1554     \advance\@tempdimb -\@wholewidth
1555     \edef\lst@frametextsep{\the\@tempdimb}%
1556     \edef\lst@framerulewidth{\the\@wholewidth}%
1557     \lst@frameCalcDimA\@ne \@getcirc\@tempdima
1558     \@tempdimb\@tempdima \divide\@tempdimb\tw@
1559     \advance\@tempdimb -\tw@\@wholewidth
1560     \advance\@tempdimb -\lst@frametextsep
1561     \edef\lst@rulesep{\the\@tempdimb}%
1562     \fi
1563     \lst@frameMakeBoxV\lst@framebox{\ht\strutbox}{\dp\strutbox}%
1564     \def\lst@framelr{\copy\lst@framebox}%
1565     \ifx\lst@frametshape\@empty\else
1566     \lst@frameH T\lst@frametshape
1567     \ifvoid\z@\else
1568     \par\lst@parshape
1569     \@tempdima-\baselineskip \advance\@tempdima\ht\z@
1570     \ifdim\prevdepth<\@cclvi\p@\else
1571     \advance\@tempdima\prevdepth
1572     \fi
1573     \ifdim\@tempdima<\z@
1574     \vskip\@tempdima\vskip\lineskip
1575     \fi
1576     \noindent\box\z@\par
1577     \lineskiplimit\maxdimen \lineskip\z@
1578     \fi
1579     \lst@frameSpreadV\lst@framextopmargin
1580     \fi}
1581     \lst@AddToHook{EveryLine}{\lst@framelr}
1582     \global\let\lst@framelr\@empty
1583     \lst@AddToHook{DeInit}
1584     {\ifx\lst@framebshape\@empty\else \lst@frameExit \fi}
1585     \gdef\lst@frameExit{%
1586     \lst@frameSpreadV\lst@framexbottommargin
1587     \lst@frameH B\lst@framebshape
1588     \ifvoid\z@\else
1589     \everypar{}\par\lst@parshape\nointerlineskip\noindent\box\z@
1590     \fi}
1591     \gdef\lst@frameSpreadV#1{%
1592     \ifdim\z@=#1\else
1593     \everypar{}\par\lst@parshape\nointerlineskip\noindent
1594     \lst@frameMakeBoxV\z@{#1}{\z@}%
1595     \box\z@
1596     \fi}
1597     \gdef\lst@frameTR{%
1598     \vrule\@width.5\@tempdima\@height\lst@framerulewidth\@depth\z@
1599     \kern-\lst@framerulewidth
1600     \raise\lst@framerulewidth\hbox{%
1601     \vrule\@width\lst@framerulewidth\@height\z@\@depth.5\@tempdima}}
1602     \gdef\lst@frameBR{%
1603     \vrule\@width.5\@tempdima\@height\lst@framerulewidth\@depth\z@
1604     \kern-\lst@framerulewidth
1605     \vrule\@width\lst@framerulewidth\@height.5\@tempdima\@depth\z@}
1606     \gdef\lst@frameBL{%
1607     \vrule\@width\lst@framerulewidth\@height.5\@tempdima\@depth\z@
1608     \kern-\lst@framerulewidth
1609     \vrule\@width.5\@tempdima\@height\lst@framerulewidth\@depth\z@}
1610     \gdef\lst@frameTL{%
1611     \raise\lst@framerulewidth\hbox{%
1612     \vrule\@width\lst@framerulewidth\@height\z@\@depth.5\@tempdima}%
1613     \kern-\lst@framerulewidth
1614     \vrule\@width.5\@tempdima\@height\lst@framerulewidth\@depth\z@}
1615     \gdef\lst@frameRoundT{%
1616     \setbox\@tempboxa\hbox{\@circlefnt\char\@tempcnta}%
1617     \ht\@tempboxa\lst@framerulewidth
1618     \box\@tempboxa}
1619     \gdef\lst@frameRoundB{%
1620     \setbox\@tempboxa\hbox{\@circlefnt\char\@tempcnta}%
1621     \dp\@tempboxa\z@
1622     \box\@tempboxa}
1623     \gdef\lst@frameRTR{%
1624     \hb@xt@.5\@tempdima{\kern-\lst@framerulewidth
1625     \kern.5\@tempdima \lst@frameRoundT \hss}}
1626     \gdef\lst@frameRBR{%
1627     \hb@xt@.5\@tempdima{\kern-\lst@framerulewidth
1628     \advance\@tempcnta\@ne \kern.5\@tempdima \lst@frameRoundB \hss}}
1629     \gdef\lst@frameRBL{%
1630     \advance\@tempcnta\tw@ \lst@frameRoundB
1631     \kern-.5\@tempdima}
1632     \gdef\lst@frameRTL{%
1633     \advance\@tempcnta\thr@@\lst@frameRoundT
1634     \kern-.5\@tempdima}
1635     \lst@EndAspect
1636     \lst@BeginAspect[keywords]{make}
1637     \lst@NewMode\lst@makemode
1638     \lst@AddToHook{Output}{%
1639     \ifnum\lst@mode=\lst@makemode
1640     \ifx\lst@thestyle\lst@gkeywords@sty
1641     \lst@makekeytrue
1642     \fi
1643     \fi}
1644     \gdef\lst@makekeytrue{\let\lst@ifmakekey\iftrue}
1645     \gdef\lst@makekeyfalse{\let\lst@ifmakekey\iffalse}
1646     \global\lst@makekeyfalse % init
1647     \lst@Key{makemacrouse}f[t]{\lstKV@SetIf{#1}\lst@ifmakemacrouse}
1648     \gdef\lst@MakeSCT{%
1649     \lst@ifmakemacrouse
1650     \lst@ReplaceInput{$(}{%
1651     \lst@PrintToken
1652     \lst@EnterMode\lst@makemode{\lst@makekeyfalse}%
1653     \lst@Merge{\lst@ProcessOther\$\lst@ProcessOther(}}%
1654     \lst@ReplaceInput{)}{%
1655     \ifnum\lst@mode=\lst@makemode
1656     \lst@PrintToken
1657     \begingroup
1658     \lst@ProcessOther)%
1659     \lst@ifmakekey
1660     \let\lst@currstyle\lst@gkeywords@sty
1661     \fi
1662     \lst@OutputOther
1663     \endgroup
1664     \lst@LeaveMode
1665     \else
1666     \expandafter\lst@ProcessOther\expandafter)%
1667     \fi}%
1668     \else
1669     \lst@ReplaceInput{$(}{\lst@ProcessOther\$\lst@ProcessOther(}%
1670     \fi}
1671     \lst@EndAspect
1672     \lst@BeginAspect{0.21}
1673     \lst@Key{labelstyle}{}{\def\lst@numberstyle{#1}}
1674     \lst@Key{labelsep}{10pt}{\def\lst@numbersep{#1}}
1675     \lst@Key{labelstep}{0}{%
1676     \ifnum #1=\z@ \KV@lst@numbers{none}%
1677     \else \KV@lst@numbers{left}\fi
1678     \def\lst@stepnumber{#1\relax}}
1679     \lst@Key{firstlabel}\relax{\def\lst@firstnumber{#1\relax}}
1680     \lst@Key{advancelabel}\relax{\def\lst@advancenumber{#1\relax}}
1681     \let\c@lstlabel\c@lstnumber
1682     \lst@AddToHook{Init}{\def\thelstnumber{\thelstlabel}}
1683     \newcommand*\thelstlabel{\@arabic\c@lstlabel}
1684     \lst@Key{first}\relax{\def\lst@firstline{#1\relax}}
1685     \lst@Key{last}\relax{\def\lst@lastline{#1\relax}}
1686     \lst@Key{framerulewidth}{.4pt}{\def\lst@framerulewidth{#1}}
1687     \lst@Key{framerulesep}{2pt}{\def\lst@rulesep{#1}}
1688     \lst@Key{frametextsep}{3pt}{\def\lst@frametextsep{#1}}
1689     \lst@Key{framerulecolor}{}{\lstKV@OptArg[]{#1}%
1690     {\ifx\@empty##2\@empty
1691     \let\lst@rulecolor\@empty
1692     \else
1693     \ifx\@empty##1\@empty
1694     \def\lst@rulecolor{\color{##2}}%
1695     \else
1696     \def\lst@rulecolor{\color[##1]{##2}}%
1697     \fi
1698     \fi}}
1699     \lst@Key{backgroundcolor}{}{\lstKV@OptArg[]{#1}%
1700     {\ifx\@empty##2\@empty
1701     \let\lst@bkgcolor\@empty
1702     \else
1703     \ifx\@empty##1\@empty
1704     \def\lst@bkgcolor{\color{##2}}%
1705     \else
1706     \def\lst@bkgcolor{\color[##1]{##2}}%
1707     \fi
1708     \fi}}
1709     \lst@Key{framespread}{\z@}{\def\lst@framespread{#1}}
1710     \lst@AddToHook{PreInit}
1711     {\@tempdima\lst@framespread\relax \divide\@tempdima\tw@
1712     \edef\lst@framextopmargin{\the\@tempdima}%
1713     \let\lst@framexrightmargin\lst@framextopmargin
1714     \let\lst@framexbottommargin\lst@framextopmargin
1715     \advance\@tempdima\lst@xleftmargin\relax
1716     \edef\lst@framexleftmargin{\the\@tempdima}}
1717     \newdimen\lst@innerspread \newdimen\lst@outerspread
1718     \lst@Key{spread}{\z@,\z@}{\lstKV@CSTwoArg{#1}%
1719     {\lst@innerspread##1\relax
1720     \ifx\@empty##2\@empty
1721     \divide\lst@innerspread\tw@\relax
1722     \lst@outerspread\lst@innerspread
1723     \else
1724     \lst@outerspread##2\relax
1725     \fi}}
1726     \lst@AddToHook{BoxUnsafe}{\lst@outerspread\z@ \lst@innerspread\z@}
1727     \lst@Key{wholeline}{false}[t]{\lstKV@SetIf{#1}\lst@ifresetmargins}
1728     \lst@Key{indent}{\z@}{\def\lst@xleftmargin{#1}}
1729     \lst@AddToHook{PreInit}
1730     {\lst@innerspread=-\lst@innerspread
1731     \lst@outerspread=-\lst@outerspread
1732     \ifodd\c@page \advance\lst@innerspread\lst@xleftmargin
1733     \else \advance\lst@outerspread\lst@xleftmargin \fi
1734     \ifodd\c@page
1735     \edef\lst@xleftmargin{\the\lst@innerspread}%
1736     \edef\lst@xrightmargin{\the\lst@outerspread}%
1737     \else
1738     \edef\lst@xleftmargin{\the\lst@outerspread}%
1739     \edef\lst@xrightmargin{\the\lst@innerspread}%
1740     \fi}
1741     \lst@Key{defaultclass}\relax{\def\lst@classoffset{#1}}
1742     \lst@Key{stringtest}\relax{}% dummy
1743     \lst@Key{outputpos}\relax{\lst@outputpos#1\relax\relax}
1744     \lst@Key{stringspaces}\relax[t]{\lstKV@SetIf{#1}\lst@ifshowstringspaces}
1745     \lst@Key{visisblespaces}\relax[t]{\lstKV@SetIf{#1}\lst@ifshowspaces}
1746     \lst@Key{visibletabs}\relax[t]{\lstKV@SetIf{#1}\lst@ifshowtabs}
1747     \lst@EndAspect
1748     \lst@