source: doc/LaTeXmacros/lstlang.sty @ a3c7bac

Last change on this file since a3c7bac was e20c0af, checked in by Peter A. Buhr <pabuhr@…>, 18 months ago

update list of CFA keywords in lstlang.sty

  • Property mode set to 100644
File size: 5.7 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 : Tue May  2 08:52:35 2023
11%% Update Count     : 30
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__, and, asm, __asm, __asm__, _Atomic, __attribute, __attribute__,
115                __auto_type, basetypeof, _Bool, catch, catchResume, choose, coerce, _Complex, __complex, __complex__, __const, __const__,
116                coroutine, _Decimal32, _Decimal64, _Decimal128, disable, enable, exception, __extension__, fallthrough, fallthru, finally, fixup,
117                __float80, float80, __float128, float128, _Float16, _Float32, _Float32x, _Float64, _Float64x, _Float128, _Float128x,
118                forall, fortran, generator, _Generic, _Imaginary, __imag, __imag__, inline, __inline, __inline__, int128, __int128, __int128_t,
119                __label__, monitor, mutex, _Noreturn, __builtin_offsetof, one_t, or, recover, report, restrict, __restrict, __restrict__,
120                __signed, __signed__, _Static_assert, suspend, thread, __thread, _Thread_local, throw, throwResume, timeout, trait, try,
121                typeof, __typeof, __typeof__, typeid, __uint128_t, __builtin_va_arg, __builtin_va_list, virtual, __volatile, __volatile__,
122                vtable, waitfor, waituntil, when, with, zero_t,
123    },
124        moredirectives={defined,include_next}%
125}
126
127% C++ programming language
128\lstdefinelanguage{C++}[ANSI]{C++}{
129        morekeywords={nullptr,}
130}
131
132% uC++ programming language, based on ANSI C++
133\lstdefinelanguage{uC++}[ANSI]{C++}{
134        morekeywords={
135                _Accept, _AcceptReturn, _AcceptWait, _Actor, _At, _Catch, _CatchResume, _CorActor, _Cormonitor, _Coroutine,
136                _Disable, _Else, _Enable, _Event, _Finally, _Monitor, _Mutex, _Nomutex, _PeriodicTask, _RealTimeTask,
137                _Resume, _ResumeTop, _Select, _SporadicTask, _Task, _Timeout, _When, _With, _Throw},
138}
139
140% Local Variables: %
141% tab-width: 4 %
142% fill-column: 100 %
143% End: %
Note: See TracBrowser for help on using the repository browser.