%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Latex -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
%% 
%% lstlang.sty -- 
%% 
%% Author           : Peter A. Buhr
%% Created On       : Sat May 13 16:34:42 2017
%% Last Modified By : Peter A. Buhr
%% Last Modified On : Sat May 13 16:49:09 2017
%% Update Count     : 4
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Go programming language: https://github.com/julienc91/listings-golang/blob/master/listings-golang.sty
\lstdefinelanguage{Golang}{
	morekeywords=[1]{package,import,func,type,struct,return,defer,panic,recover,select,var,const,iota,},
	morekeywords=[2]{string,uint,uint8,uint16,uint32,uint64,int,int8,int16,int32,int64,
		bool,float32,float64,complex64,complex128,byte,rune,uintptr, error,interface},
	morekeywords=[3]{map,slice,make,new,nil,len,cap,copy,close,true,false,delete,append,real,imag,complex,chan,},
	morekeywords=[4]{for,break,continue,range,goto,switch,case,fallthrough,if,else,default,},
	morekeywords=[5]{Println,Printf,Error,},
	sensitive=true,
	morecomment=[l]{//},
	morecomment=[s]{/*}{*/},
	morestring=[b]',
	morestring=[b]",
	morestring=[s]{`}{`},
}

% from https://gist.github.com/nikolajquorning/92bbbeef32e1dd80105c9bf2daceb89a
\lstdefinelanguage{sml} {
	morekeywords= {
		EQUAL, GREATER, LESS, NONE, SOME, abstraction, abstype, and, andalso, array, as, before, bool,
		case, char, datatype, do, else, end, eqtype, exception, exn, false, fn, fun, functor, handle,
		if, in, include, infix, infixr, int, let, list, local, nil, nonfix, not, o, of, op, open,
		option, orelse, overload, print, raise, real, rec, ref, sharing, sig, signature, string, struct,
		structure, substring, then, true, type, unit, val, vector, where, while, with, withtype, word
	},
	morestring=[b]",
	morecomment=[s]{(*}{*)},
}

\lstdefinelanguage{D}{
	% Keywords
	morekeywords=[1]{
		abstract, alias, align, auto, body, break, cast, catch, class, const, continue, debug,
		delegate, delete, deprecated, do, else, enum, export, false, final, finally, for, foreach,
		foreach_reverse, function, goto, if, immutable, import, in, inout, interface, invariant, is,
		lazy, macro, mixin, module, new, nothrow, null, out, override, package, pragma, private,
		protected, public, pure, ref, return, shared, static, struct, super, switch, synchronized,
		template, this, throw, true, try, typedef, typeid, typeof, union, unittest, volatile, while,
		with
	},
	% Special identifiers, common functions
	morekeywords=[2]{enforce},
	% Ugly identifiers
	morekeywords=[3]{
		__DATE__, __EOF__, __FILE__, __LINE__, __TIMESTAMP__, __TIME__, __VENDOR__,
		__VERSION__, __ctfe, __gshared, __monitor, __thread, __vptr, _argptr,
		_arguments, _ctor, _dtor
	},
	% Basic types
	morekeywords=[4]{
		byte, ubyte, short, ushort, int, uint, long, ulong, cent, ucent, void, bool, bit, float,
		double, real, ushort, int, uint, long, ulong, float, char, wchar, dchar, string, wstring,
		dstring, ireal, ifloat, idouble, creal, cfloat, cdouble, size_t, ptrdiff_t, sizediff_t,
		equals_t, hash_t
	},
	% Strings
	morestring=[b]{"},
	morestring=[b]{'},
	morestring=[b]{`},
	% Comments
	comment=[l]{//},
	morecomment=[s]{/*}{*/},
	morecomment=[s][\color{blue}]{/**}{*/},
	morecomment=[n]{/+}{+/},
	morecomment=[n][\color{blue}]{/++}{+/},
	% Options
	sensitive=true
}

\lstdefinelanguage{rust}{
	morekeywords=[1]{
		abstract, alignof, as, become, box, break, const, continue, crate, do, else, enum, extern,
        false, final, fn, for, if, impl, in, let, loop, macro, match, mod, move, mut, offsetof,
        override, priv, proc, pub, pure, ref, return, Self, self, sizeof, static, struct, super,
        trait, true, type, typeof, unsafe, unsized, use, virtual, where, while, yield
	},
	morestring=[b]{"},
	comment=[l]{//},
	morecomment=[s]{/*}{*/},
	sensitive=true
}

\lstdefinelanguage{Pseudo}{
	morekeywords={string,uint,int,bool,float},
	sensitive=true,
	morecomment=[l]{//},
	morecomment=[s]{/*}{*/},
	morestring=[b]',
	morestring=[b]",
	morestring=[s]{`}{`},
}

% CFA programming language, based on ANSI C (with some gcc additions)
\lstdefinelanguage{CFA}[ANSI]{C}{
	morekeywords={
		_Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, _At, _Atomic, __attribute,
		__attribute__, auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__,
		__const, __const__, coroutine, disable, dtype, enable, __extension__, fallthrough, fallthru,
		finally, forall, ftype, _Generic, _Imaginary, inline, __label__, lvalue, monitor, mutex,
		_Noreturn, one_t, otype, restrict, _Static_assert, thread, _Thread_local, throw, throwResume,
		trait, try, ttype, typeof, __typeof, __typeof__, zero_t},
}

% Local Variables: %
% tab-width: 4 %
% fill-column: 100 %
% End: %
