diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/listings/lstdrvrs.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/listings/lstdrvrs.dtx | 138 |
1 files changed, 124 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx b/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx index 10253633a27..3dd876c7aa2 100644 --- a/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx +++ b/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx @@ -1,6 +1,6 @@ % \iffalse % -% $Id: lstdrvrs.dtx 126 2014-03-04 19:53:34Z j_hoffmann $ +% $Id: lstdrvrs.dtx 151 2014-09-06 17:21:33Z j_hoffmann $ % %<*driver> \documentclass{ltxdoc} @@ -32,7 +32,7 @@ % % \title{Language, Style and Format drivers\\ for \textsf{Listings}\\ {\large by Carsten Heinz and individual authors:}} % \author{\InputIfFileExists{lstdrvrs.tmp}{}{}} -% \date{2014/03/04\enspace\enspace Version 1.5c\ \box\abstractbox} +% \date{2014/09/06\enspace\enspace Version 1.5e\ \box\abstractbox} % % \hypersetup{pdfsubject=Language definitions,pdfauthor=Jobst Hoffmann % <j.hoffmann-(at)-fh-aachen.de>} @@ -101,6 +101,7 @@ \generate{ \file{listings-acm.prf}{\from{lstdrvrs.dtx}{acm-prf}} + \file{listings-bash.prf}{\from{lstdrvrs.dtx}{bash-prf}} \file{listings-fortran.prf}{\from{lstdrvrs.dtx}{fortran-prf}} \file{listings-lua.prf}{\from{lstdrvrs.dtx}{lua-prf}} \file{listings-python.prf}{\from{lstdrvrs.dtx}{python-prf}} @@ -128,7 +129,7 @@ % \endgroup % We mainly define default dialects. % \begin{macrocode} -\ProvidesFile{listings.cfg}[2014/03/04 1.5c listings configuration] +\ProvidesFile{listings.cfg}[2014/09/06 1.5e listings configuration] \def\lstlanguagefiles {lstlang0.sty,lstlang1.sty,lstlang2.sty,lstlang3.sty} \lstset{defaultdialect=[R/3 6.10]ABAP, @@ -170,10 +171,11 @@ %<+lang2>\ProvidesFile{lstlang2.sty} %<+lang3>\ProvidesFile{lstlang3.sty} %<+acm-prf>\ProvidesFile{listings-acm.prf} +%<+bash-prf>\ProvidesFile{listings-bash.prf} %<+fortran-prf>\ProvidesFile{listings-fortran.prf} %<+lua-prf>\ProvidesFile{listings-lua.prf} %<+python-prf>\ProvidesFile{listings-python.prf} -%<-config> [2014/03/04 1.5c listings language file] +%<-config> [2014/09/06 1.5e listings language file] % \end{macrocode} % % @@ -831,6 +833,16 @@ SUBX,SWAP,TAS,TRAP,TRAPV,TST,UNLK},% % \begin{macrocode} %<*lang1> % \end{macrocode} +% \lstthanks{Michael Fiedler}{post@michael-fiedler.net}{2014/09/04} +% provided the following list of new introduced keywords for C++11. +% \begin{macrocode} +\lst@definelanguage[11]{C++}[ISO]{C++}% + {morekeywords={alignas,alignof,char16_t,char32_t,constexpr,% + decltype,noexcept,nullptr,static_assert,thread_local},% + }% +% \end{macrocode} +% \lstthanks{Michael Piefel}{piefel@informatik.hu-berlin.de}{2001/11/21} +% suggested some more changes and added GNU C++. % For compatibility the `ANSI' language is defined in terms of ISO. % \begin{macrocode} \lst@definelanguage[ANSI]{C++}[ISO]{C++}{}% @@ -1369,22 +1381,30 @@ SUBX,SWAP,TAS,TRAP,TRAPV,TST,UNLK},% }[keywords,comments,strings]% % \end{macrocode} % Thanks to \lstthanks{Riccardo~Murri}{riccardo.murri@gmx.it}{2003/09/24} -% for the following two definitions. +% for the following two +% definitions. \lstthanks{Scott~Pakin}{scott@pakin.org}{2014/08/08} pointed +% out some missing keywords (|elif|, |in| for |sh|, |caller|, |compopt|, +% |coproc|, |dirs|, |help|, |mapfile|, |readarray| for |bash|) to the +% current maintainer. The |sh| list of keywords was checkead against the +% ``Manual of the Bourne Shell on Version 7'', found at +% \url{http://www.in-ulm.de/~mascheck/bourne/v7/}, last visited on +% 2014/09/06. % \begin{macrocode} %% %% bash,sh definition (c) 2003 Riccardo Murri <riccardo.murri@gmx.it> %% \lst@definelanguage{bash}[]{sh}% - {morekeywords={alias,bg,bind,builtin,command,compgen,complete,% - declare,disown,enable,fc,fg,history,jobs,et,local,logout,printf,% - pushd,popd,select,set,suspend,shopt,source,times,type,typeset,% - ulimit,unalias,wait},% + {morekeywords={alias,bg,bind,builtin,caller,command,compgen,compopt,% + complete,coproc,declare,disown,dirs,enable,fc,fg,help,history,% + jobs,let,local,logout,mapfile,printf,pushd,popd,readarray,select,% + set,suspend,shopt,source,times,type,typeset,ulimit,unalias,wait},% }% \lst@definelanguage{sh}% - {morekeywords={awk,break,case,cat,cd,continue,do,done,echo,else,% - env,eval,exec,expr,exit,export,false,fi,for,function,getopts,% - hash,history,if,kill,nice,nohup,ps,pwd,read,readonly,return,% - sed,shift,test,then,times,trap,true,umask,unset,until,while},% + {morekeywords={awk,break,case,cat,cd,continue,do,done,echo,elif,else,% + env,esac,eval,exec,exit,export,expr,false,fi,for,function,getopts,% + hash,history,if,in,kill,login,newgrp,nice,nohup,ps,pwd,read,% + readonly,return,set,sed,shift,test,then,times,trap,true,type,% + ulimit,umask,unset,until,wait,while},% morecomment=[l]\#,% morestring=[d]"% }[keywords,comments,strings]% @@ -1392,6 +1412,62 @@ SUBX,SWAP,TAS,TRAP,TRAPV,TST,UNLK},% % \end{macrocode} % \endgroup % +% \begingroup +% Jobst Hoffmann copied the definition of a style for printing Fortran code +% to a style for printing shell programs: +% \begin{macrocode} +%<*bash-prf> +% \end{macrocode} +% \begin{macrocode} +\usepackage[rgb, x11names]{xcolor} + +% common settings +\lstset{% + frame=tlb,% the frame is open on the right side + resetmargins=false,% + rulesepcolor=\color{black},% + numbers=left,% % left + numberstyle=\tiny,% + numbersep=5pt,% + firstnumber=1,% + stepnumber=5,% + columns=fixed,% % to prevent inserting spaces + fontadjust=true,% + keepspaces=true,% + basewidth=0.5em,% + captionpos=t,% + abovecaptionskip=\smallskipamount,% same amount as default + belowcaptionskip=\smallskipamount,% in caption package +} +% settings for colored printing +\lstdefinestyle{bash}{% + backgroundcolor=\color{yellow!10},% + basicstyle=\small\ttfamily,% + identifierstyle=\color{black},% + keywordstyle=\color{blue},% + keywordstyle={[2]\color{cyan}},% + keywordstyle={[3]\color{olive}},% + stringstyle=\color{teal},% + commentstyle=\itshape\color{orange},% +}% +% settings for back and white printing +\lstdefinestyle{bashbw}{% + backgroundcolor={},% + basicstyle=\small\ttfamily,% + identifierstyle={},% + keywordstyle=\bfseries,% + stringstyle=\itshape,% + commentstyle=\slshape,% + rulesepcolor=\color{black},% +}% +% \end{macrocode} +% This code is provided in the file |listings-bash.prf|, see section +% 2.4.1 (Preferences) of the \packagename{listings} documentation. +% \begin{macrocode} +%</bash-prf> +% \end{macrocode} +% \endgroup +% % % \subsection{Delphi} % @@ -2327,7 +2403,7 @@ SUBX,SWAP,TAS,TRAP,TRAPV,TST,UNLK},% % \endgroup % % -% \subsection{Java} +% \subsection{Java and other JVM based languages} % % \lstthanks{Robert~Wenner}{robert.wenner@gmx.de}{2003/03/27} sent in the % first of the following two definitions. @@ -2448,6 +2524,40 @@ SUBX,SWAP,TAS,TRAP,TRAPV,TST,UNLK},% % \endgroup % % +% \subsubsection{Scala} +% +% \lstthanks{Bastian Germann}{bastian.germann@nordakademie.de}{2013/10/19} +% asked to include the Scala definition provided by Frank Teubler +% (2009). Here it is: +% \begingroup +% \begin{macrocode} +%<*lang3> +% \end{macrocode} +% \begin{macrocode} +\lst@definelanguage{Scala}% + {morekeywords={abstract,case,catch,class,def,% + do,else,extends,false,final,finally,% + for,if,implicit,import,lazy,match,mixin,% + new,null,object,override,package,% + private,protected,requires,return,sealed,% + super,this,trait,true,try,% + type,val,var,while,with,yield},%+ +% otherkeywords={_,:,=,=>,<<:,<\%,>:,\#,@},% + otherkeywords={=,=>,<-,<\%,<:,>:,\#,@},% + sensitive,% + morecomment=[l]//,% + morecomment=[n]{/*}{*/},% + morestring=[b]",% + morestring=[b]',% + morestring=[b]""",% + }[keywords,comments,strings]% +% \end{macrocode} +% \begin{macrocode} +%</lang3> +% \end{macrocode} +% \endgroup +% +% % \subsection{ksh} % % Thanks to \lstthanks{Jeffrey Ratcliffe}{Jeffrey.Ratcliffe@m.eads.net} |