source: doc/LaTeXmacros/lstlang.sty @ 0a89a8f

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumwith_gc
Last change on this file since 0a89a8f was 9ca94af, checked in by Peter A. Buhr <pabuhr@…>, 7 years ago

add additional CFA and gcc keywords

  • Property mode set to 100644
File size: 5.4 KB
Line 
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Latex -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%%
3%% Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
4%%
5%% lstlang.sty --
6%%
7%% Author           : Peter A. Buhr
8%% Created On       : Sat May 13 16:34:42 2017
9%% Last Modified By : Peter A. Buhr
10%% Last Modified On : Fri Apr  6 23:44:50 2018
11%% Update Count     : 20
12%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13
14% Go programming language: https://github.com/julienc91/listings-golang/blob/master/listings-golang.sty
15\lstdefinelanguage{Golang}{
16        morekeywords=[1]{package,import,func,type,struct,return,defer,panic,recover,select,var,const,iota,},
17        morekeywords=[2]{string,uint,uint8,uint16,uint32,uint64,int,int8,int16,int32,int64,
18                bool,float32,float64,complex64,complex128,byte,rune,uintptr, error,interface},
19        morekeywords=[3]{map,slice,make,new,nil,len,cap,copy,close,true,false,delete,append,real,imag,complex,chan,},
20        morekeywords=[4]{for,break,continue,range,goto,switch,case,fallthrough,if,else,default,},
21        morekeywords=[5]{Println,Printf,Error,},
22        sensitive=true,
23        morecomment=[l]{//},
24        morecomment=[s]{/*}{*/},
25        morestring=[b]',
26        morestring=[b]",
27        morestring=[s]{`}{`},
28}
29
30% from https://gist.github.com/nikolajquorning/92bbbeef32e1dd80105c9bf2daceb89a
31\lstdefinelanguage{sml} {
32        morekeywords= {
33                EQUAL, GREATER, LESS, NONE, SOME, abstraction, abstype, and, andalso, array, as, before,
34                bool, case, char, datatype, do, else, end, eqtype, exception, exn, false, fn, fun, functor,
35                handle, if, in, include, infix, infixr, int, let, list, local, nil, nonfix, not, o, of, op,
36                open, option, orelse, overload, print, raise, real, rec, ref, sharing, sig, signature,
37                string, struct, structure, substring, then, true, type, unit, val, vector, where, while,
38                with, withtype, word
39    },
40    morestring=[b]",
41    morecomment=[s]{(*}{*)},
42}
43
44\lstdefinelanguage{D}{
45        % Keywords
46        morekeywords=[1]{
47                abstract, alias, align, auto, body, break, cast, catch, class, const, continue, debug,
48                delegate, delete, deprecated, do, else, enum, export, false, final, finally, for, foreach,
49                foreach_reverse, function, goto, if, immutable, import, in, inout, interface, invariant, is,
50                lazy, macro, mixin, module, new, nothrow, null, out, override, package, pragma, private,
51                protected, public, pure, ref, return, shared, static, struct, super, switch, synchronized,
52                template, this, throw, true, try, typedef, typeid, typeof, union, unittest, volatile, while,
53                with
54        },
55        % Special identifiers, common functions
56        morekeywords=[2]{enforce},
57        % Ugly identifiers
58        morekeywords=[3]{
59                __DATE__, __EOF__, __FILE__, __LINE__, __TIMESTAMP__, __TIME__, __VENDOR__,
60                __VERSION__, __ctfe, __gshared, __monitor, __thread, __vptr, _argptr,
61                _arguments, _ctor, _dtor
62        },
63        % Basic types
64        morekeywords=[4]{
65                byte, ubyte, short, ushort, int, uint, long, ulong, cent, ucent, void, bool, bit, float,
66                double, real, ushort, int, uint, long, ulong, float, char, wchar, dchar, string, wstring,
67                dstring, ireal, ifloat, idouble, creal, cfloat, cdouble, size_t, ptrdiff_t, sizediff_t,
68                equals_t, hash_t
69        },
70        % Strings
71        morestring=[b]{"},
72        morestring=[b]{'},
73        morestring=[b]{`},
74        % Comments
75        comment=[l]{//},
76        morecomment=[s]{/*}{*/},
77        morecomment=[s][\color{blue}]{/**}{*/},
78        morecomment=[n]{/+}{+/},
79        morecomment=[n][\color{blue}]{/++}{+/},
80        % Options
81        sensitive=true
82}
83
84\lstdefinelanguage{rust}{
85        % Keywords
86        morekeywords=[1]{
87                abstract, alignof, as, become, box, break, const, continue, crate, do, else, enum, extern,
88                false, final, fn, for, if, impl, in, let, loop, macro, match, mod, move, mut, offsetof,
89                override, priv, proc, pub, pure, ref, return, Self, self, sizeof, static, struct, super,
90                trait, true, type, typeof, unsafe, unsized, use, virtual, where, while, yield
91        },
92        % Strings
93        morestring=[b]{"},
94        % Comments
95        comment=[l]{//},
96        morecomment=[s]{/*}{*/},
97        % Options
98        sensitive=true
99}
100
101\lstdefinelanguage{pseudo}{
102        morekeywords={string,uint,int,bool,float},
103        sensitive=true,
104        morecomment=[l]{//},
105        morecomment=[s]{/*}{*/},
106        morestring=[b]',
107        morestring=[b]",
108        morestring=[s]{`}{`},
109}
110
111% CFA programming language, based on ANSI C (with some gcc additions)
112\lstdefinelanguage{CFA}[ANSI]{C}{
113        morekeywords={
114                _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__,
115                auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, __const, __const__,
116                coroutine, disable, dtype, enable, __extension__, exception, fallthrough, fallthru, finally,
117                __float80, float80, __float128, float128, forall, ftype, _Generic, _Imaginary, __imag, __imag__,
118                inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or,
119                otype, restrict, __restrict, __restrict__, __signed, __signed__, _Static_assert, thread,
120                _Thread_local, throw, throwResume, timeout, trait, try, ttype, typeof, __typeof, __typeof__,
121                virtual, __volatile, __volatile__, waitfor, when, with, zero_t,
122    },
123        moredirectives={defined,include_next}%
124}
125
126% C++ programming language
127\lstdefinelanguage{C++}[ANSI]{C++}{}
128
129% uC++ programming language, based on ANSI C++
130\lstdefinelanguage{uC++}[ANSI]{C++}{
131        morekeywords={
132                _Accept, _AcceptReturn, _AcceptWait, _Actor, _At, _CatchResume, _Cormonitor, _Coroutine, _Disable,
133                _Else, _Enable, _Event, _Finally, _Monitor, _Mutex, _Nomutex, _PeriodicTask, _RealTimeTask,
134                _Resume, _Select, _SporadicTask, _Task, _Timeout, _When, _With, _Throw},
135}
136
137% Local Variables: %
138% tab-width: 4 %
139% fill-column: 100 %
140% End: %
Note: See TracBrowser for help on using the repository browser.