From dac20b845caec4572d30925f364d494e257f0e43 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 11 Jul 2013 23:22:08 +0000 Subject: listings (11jul13) git-svn-id: svn://tug.org/texlive/trunk@31161 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/listings/lstdrvrs.dtx | 332 ++++++++++++++++++++- 1 file changed, 326 insertions(+), 6 deletions(-) (limited to 'Master/texmf-dist/source/latex/listings/lstdrvrs.dtx') diff --git a/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx b/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx index e33c20de561..7693613079a 100644 --- a/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx +++ b/Master/texmf-dist/source/latex/listings/lstdrvrs.dtx @@ -1,7 +1,10 @@ % \iffalse % +% $Id: lstdrvrs.dtx 43 2013-06-27 15:26:50Z j_hoffmann $ +% %<*driver> \documentclass{ltxdoc} +\usepackage{url} \EnableCrossrefs \CodelineIndex \begin{document} @@ -20,7 +23,7 @@ % \DoNotIndex{\undefined} % % -% \title{Language, Style and Format drivers\\ for \textsf{Listings 1.3}\\ {\large by Carsten Heinz and individual authors:}} +% \title{Language, Style and Format drivers\\ for \textsf{Listings 1.5pre1}\\ {\large by Carsten Heinz and individual authors:}} % \author{\InputIfFileExists{lstdrvrs.tmp}{}{}} % \date{} % @@ -97,7 +100,7 @@ % \endgroup % We mainly define default dialects. % \begin{macrocode} -\ProvidesFile{listings.cfg}[2007/02/22 1.4 listings configuration] +\ProvidesFile{listings.cfg}[2013/06/27 1.5pre1 listings configuration] \def\lstlanguagefiles {lstlang0.sty,lstlang1.sty,lstlang2.sty,lstlang3.sty} \lstset{defaultdialect=[R/3 6.10]ABAP, @@ -107,7 +110,7 @@ defaultdialect=[ANSI]C, defaultdialect=[light]Caml, defaultdialect=[1985]Cobol, - defaultdialect=[WinXP]command.com, + defaultdialect=[WinXP]command.com, defaultdialect=[ISO]C++, defaultdialect=[95]Fortran, defaultdialect=[5.2]Mathematica, @@ -138,7 +141,7 @@ %<+lang1>\ProvidesFile{lstlang1.sty} %<+lang2>\ProvidesFile{lstlang2.sty} %<+lang3>\ProvidesFile{lstlang3.sty} -%<-config> [2004/09/05 1.3 listings language file] +%<-config> [2013/06/27 1.5pre1 listings language file] % \end{macrocode} % % @@ -1479,10 +1482,31 @@ SUBX,SWAP,TAS,TRAP,TRAPV,TST,UNLK},% % Mannheim; Leipzig; Wien; Z\"urich: BI-Wiss.-Verlag, 1994; % ISBN 3-411-16861-7. % \end{itemize} +% Another source for Fortran keywords is +% \url{http://fortranwiki.org/fortran/show/Keywords} where the keywords for +% Fortran 2003 and 2008 are taken from. % \begingroup % \begin{macrocode} %<*lang1> % \end{macrocode} +% The current version of Fortran (Fortran 2008) is defined in ... +% It contains four keywords consisting of two words: |ERROR STOP|, ^^A +% |SYNC ALL|, |SYNC IMAGES|, |SYNC MEMORY|, so the lists contains the +% single parts |ALL|, |IMAGES|, |MEMORY|, and |SYNC| +% \begin{macrocode} +\lst@definelanguage[08]{Fortran}[03]{Fortran}{% + morekeywords={ALL, BLOCK, CODIMENSION, CONCURRENT, CONTIGUOUS, CRITICAL,% + ERROR, LOCK, SUBMODULE, SYNC, UNLOCK}% +}% +% \end{macrocode} +% Fortran 2003 introduces the following keywords: +% \begin{macrocode} +\lst@definelanguage[03]{Fortran}[95]{Fortran}{% + morekeywords={ABSTRACT, ASSOCIATE, ASYNCHRONOUS, BIND, CLASS, DEFERRED,% + ENUM, ENUMERATOR, EXTENDS, FINAL, FLUSH, GENERIC, IMPORT,% + NON_OVERRIDABLE, NOPASS, PASS, PROTECTED, VALUE, VOLATILE, WAIT}% +}% +% \end{macrocode} % \lsthelper{Denis Girou}{Denis.Girou@idris.fr}{1998/07/26}{Fortran 95=90} % proposed to have Fortran 95 and Fortran 90 to be equivalent. % \begin{macrocode} @@ -1503,7 +1527,14 @@ SUBX,SWAP,TAS,TRAP,TRAPV,TST,UNLK},% TARGET,USE,WHERE,WHILE,BLOCKDATA,DOUBLEPRECISION,% ENDBLOCKDATA,ENDFILE,ENDFUNCTION,ENDINTERFACE,% ENDMODULE,ENDPROGRAM,ENDSELECT,ENDSUBROUTINE,ENDTYPE,ENDWHERE,% - INOUT,SELECTCASE},% + INOUT,SELECTCASE,% +% \end{macrocode} +% Theses keys were missing from the 1.4 version of listings: +% \begin{macrocode} + ELEMENTAL, ELSEWHERE, FORALL, PURE},% +% \end{macrocode} +% and here are the final settings for Fortran +% \begin{macrocode} deletecomment=[f],% no fixed comment line: 1998 Magne Rudshaug morecomment=[l]!% }% @@ -1837,7 +1868,7 @@ SUBX,SWAP,TAS,TRAP,TRAPV,TST,UNLK},% static,supporter,switchable,talkable,transparent,visited,% workflag,worn},% % - % Libary properties + % Library properties morekeywords=[5]{n_to,s_to,e_to,w_to,ne_to,nw_to,se_to,sw_to,in_to,% out_to,u_to,d_to,add_to_scope,after,article,articles,before,% cant_go,capacity,daemon,describe,description,door_dir,door_to,% @@ -2472,6 +2503,295 @@ SUBX,SWAP,TAS,TRAP,TRAPV,TST,UNLK},% % \endgroup % % +% \subsection{Lua} +% +% \lstthanks{Stephan Hennig}{sh2d@arcor.de}{2013/06/14} contributed the Lua +% keywords. +% \begingroup +% \begin{macrocode} +%<*lang2> +% \end{macrocode} +% We begin with the keywords for Lua 5.0: +% \begin{macrocode} +%% +%% Lua definitions (c) 2013 Stephan Hennig +%% +\lst@definelanguage[5.0]{Lua}{% +% \end{macrocode} +% To enable highlighting of library keywords, the dot needs to be a +% letter. +% \begin{macrocode} + alsoletter={.},% +% \end{macrocode} +% The language definition knows +% \begin{itemize} +% \item language keywords +% \begin{macrocode} + morekeywords=[1]{% + and, break, do, else, elseif, end, false, for, function, if, in,% + local, nil, not, or, repeat, return, then, true, until, while,% + },% +% \end{macrocode} +% \item the standard library identifiers +% \begin{macrocode} + morekeywords=[2]{% +% \end{macrocode} +% \begin{itemize} +% \item coming from the base library +% \begin{macrocode} + _G, _LOADED, _REQUIREDNAME, _VERSION, LUA_PATH,% + assert, collectgarbage, dofile, error, gcinfo, getfenv,% + getmetatable, ipairs, loadfile, loadlib, loadstring, newproxy,% + next, pairs, pcall, print, rawequal, rawget, rawset, require,% + setfenv, setmetatable, tonumber, tostring, type, unpack, xpcall,% +% \end{macrocode} +% \item coming from the coroutine library +% \begin{macrocode} + coroutine, coroutine.create, coroutine.resume,% + coroutine.status, coroutine.wrap, coroutine.yield,% +% \end{macrocode} +% \item the debug library +% \begin{macrocode} + _TRACEBACK, debug, debug.debug, debug.gethook, debug.getinfo,% + debug.getlocal, debug.getupvalue, debug.sethook, debug.setlocal,% + debug.setupvalue,debug.traceback,% +% \end{macrocode} +% \item the io library +% \begin{macrocode} + io, io.close, io.flush, io.input, io.lines, io.open, io.output,% + io.popen, io.read, io.stderr, io.stdin, io.stdout, io.tmpfile,% + io.type, io.write,% +% \end{macrocode} +% \item the mathematical library +% \begin{macrocode} + __pow, math, math.abs, math.acos, math.asin, math.atan, math.atan2,% + math.ceil, math.cos, math.deg, math.exp, math.floor, math.frexp,% + math.ldexp, math.log, math.log10, math.max, math.min, math.mod,% + math.pi, math.pow, math.rad, math.random, math.randomseed, math.sin,% + math.sqrt, math.tan,% +% \end{macrocode} +% \item the os library +% \begin{macrocode} + os, os.clock, os.date, os.difftime, os.execute, os.exit, os.getenv,% + os.remove, os.rename, os.setlocale, os.time, os.tmpname,% +% \end{macrocode} +% \item the string library +% \begin{macrocode} + string, string.byte, string.char, string.dump, string.find,% + string.format, string.gfind, string.gsub, string.len, string.lower,% + string.rep, string.sub, string.upper,% +% \end{macrocode} +% \item the table library +% \begin{macrocode} + table, table.concat, table.foreach, table.foreachi, table.getn,% + table.insert, table.remove, table.setn, table.sort,% + },% +% \end{macrocode} +% \end{itemize} +% and some additional identifiers +% \begin{macrocode} + morekeywords=[2]{% + _PROMPT, _PROMPT2, arg,% + },% +% \end{macrocode} +% These are the common language settings +% \begin{macrocode} + sensitive=true,% + % single line comments + morecomment=[l]{--},% + % multi line comments + morecomment=[s]{--[[}{]]},% + % backslash escaped strings + morestring=[b]",% + morestring=[b]',% + % multi line strings + morestring=[s]{[[}{]]},% +}[keywords,comments,strings]% +% \end{macrocode} +% And here are the new definitions for Lua 5.1: +% \begin{macrocode} +\lst@definelanguage[5.1]{Lua}[5.0]{Lua}{% +% \end{macrocode} +% There are some deletions +% \begin{macrocode} + deletekeywords=[2]{% +% \end{macrocode} +% concerning +% \begin{itemize} +% \item the base library +% \begin{macrocode} + _LOADED, _REQUIREDNAME, LUA_PATH, gcinfo, loadlib,% +% \end{macrocode} +% \item the debug library +% \begin{macrocode} + _TRACEBACK,% +% \end{macrocode} +% \item the mathematical library +% \begin{macrocode} + __pow, math.mod,% +% \end{macrocode} +% \item the string library +% \begin{macrocode} + string.gfind,% +% \end{macrocode} +% \item the table library +% \begin{macrocode} + table.foreach, table.foreachi, table.getn, table.setn,% + },% +% \end{macrocode} +% \end{itemize} +% and some new identifiers in standard libraries like +% \begin{macrocode} + morekeywords=[2]{% +% \end{macrocode} +% \begin{itemize} +% \item the base library +% \begin{macrocode} + load, select,% +% \end{macrocode} +% \item coroutine library +% \begin{macrocode} + coroutine.running,% +% \end{macrocode} +% \item debug library +% \begin{macrocode} + debug.getfenv, debug.getmetatable, debug.getregistry, debug.setfenv,% + debug.setmetatable,% +% \end{macrocode} +% \item the mathematical library +% \begin{macrocode} + math.cosh, math.fmod, math.huge, math.modf, math.sinh, math.tanh,% +% \end{macrocode} +% \item the package library which itself is new in Lua 5.1 +% \begin{macrocode} + module, package, package.config, package.cpath, package.loaded,% + package.loaders, package.loadlib, package.path, package.preload,% + package.seeall,% +% \end{macrocode} +% \item the string library and +% \begin{macrocode} + string.gmatch, string.match, string.reverse,% +% \end{macrocode} +% \item the table library +% \begin{macrocode} + table.maxn,% + },% +% \end{macrocode} +% \end{itemize} +% In Lua 5.1 long bracket comments were introduced also +% \begin{macrocode} + morecomment=[s]{--[=[}{]=]},% + morecomment=[s]{--[==[}{]==]},% + morecomment=[s]{--[===[}{]===]},% + morecomment=[s]{--[====[}{]====]},% + morecomment=[s]{--[=====[}{]=====]},% + morecomment=[s]{--[======[}{]======]},% + morecomment=[s]{--[=======[}{]=======]},% + morecomment=[s]{--[========[}{]========]},% + morecomment=[s]{--[=========[}{]=========]},% + morecomment=[s]{--[==========[}{]==========]},% +% \end{macrocode} +% as well as long bracket strings +% \begin{macrocode} + morestring=[s]{[=[}{]=]},% + morestring=[s]{[==[}{]==]},% + morestring=[s]{[===[}{]===]},% + morestring=[s]{[====[}{]====]},% + morestring=[s]{[=====[}{]=====]},% + morestring=[s]{[======[}{]======]},% + morestring=[s]{[=======[}{]=======]},% + morestring=[s]{[========[}{]========]},% + morestring=[s]{[=========[}{]=========]},% + morestring=[s]{[==========[}{]==========]},% +}[keywords,comments,strings]% +% \end{macrocode} +% \end{itemize} +% Lua 5.2 also has some changed features. These are +% \begin{macrocode} +\lst@definelanguage[5.2]{Lua}[5.1]{Lua}{% +% \end{macrocode} +% \begin{itemize} +% \item new language keywords +% \begin{macrocode} + morekeywords=[1]{% + goto,% + },% +% \end{macrocode} +% \item deleted identifiers from the standard libraries like +% \begin{macrocode} + deletekeywords=[2]{% +% \end{macrocode} +% \begin{itemize} +% \item the base library +% \begin{macrocode} + getfenv, loadstring, module, newproxy, setfenv, unpack,% +% \end{macrocode} +% \item the debug library +% \begin{macrocode} + debug.getfenv, debug.setfenv,% +% \end{macrocode} +% \item the mathematical library +% \begin{macrocode} + math.log10,% +% \end{macrocode} +% \item the package library and +% \begin{macrocode} + package.loaders, package.seeall,% +% \end{macrocode} +% \item the table library +% \begin{macrocode} + table.maxn,% + },% +% \end{macrocode} +% \end{itemize} +% Again there are some new identifiers in the standard libraries +% \begin{macrocode} + morekeywords=[2]{% +% \end{macrocode} +% like +% \begin{itemize} +% \item the base library +% \begin{macrocode} + rawlen,% +% \end{macrocode} +% \item the bit library +% \begin{macrocode} + bit32, bit32.arshift, bit32.band, bit32.bnot, bit32.bor,% + bit32.btest, bit32.bxor, bit32.extract, bit32.lrotate,% + bit32.lshift, bit32.replace, bit32.rrotate, bit32.rshift,% +% \end{macrocode} +% \item the debug library +% \begin{macrocode} + debug.getuservalue, debug.setuservalue, debug.upvalueid,% + debug.upvaluejoin,% +% \end{macrocode} +% \item the package library +% \begin{macrocode} + package.searchers, package.searchpath,% +% \end{macrocode} +% \item the table library +% \begin{macrocode} + table.pack, table.unpack,% + },% +% \end{macrocode} +% \end{itemize} +% There is a new additional identifier +% \begin{macrocode} + morekeywords=[2]{% + _ENV,% + },% +% \end{macrocode} +% and labels are also new in Lua 5.2 +% \begin{macrocode} + moredelim=[s][keywordstyle3]{::}{::},% +}[keywords,comments,strings]% +% \end{macrocode} +% \begin{macrocode} +% +% \end{macrocode} +% \endgroup +% +% % \subsection{Make} % % \lstthanks{Rolf~Niepraschk}{niepraschk@ptb.de}{2000/01/10} sent me the new -- cgit v1.2.3