-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlstlang0.sty
38 lines (37 loc) · 1.29 KB
/
lstlang0.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
%% Listings definition for Go language
%% Go language reference: https://golang.org/ref/spec
%% Author: Uriel Corfa <[email protected]>
%% Project home: https://github.com/korfuri/golang-latex-listings
%% More specifically:
%% - https://golang.org/ref/spec#Keywords
%% - https://golang.org/ref/spec#Predeclared_identifiers
\ProvidesFile{lstlang0.sty}
[2017/07/16 1.2 listings language file for GoLang]
\lst@definelanguage{Go}{
% Keywords as defined in the language grammar
morekeywords=[1]{%
break,default,func,interface,select,case,defer,go,map,%
struct,chan,else,goto,package,switch,const,fallthrough,%
if,range,type, continue,for,import,return,var},
% Built-in functions
morekeywords=[2]{%
append,cap,close,complex,copy,delete,imag,%
len,make,new,panic,print,println,real,recover},
% Pre-declared types
morekeywords=[3]{%
bool,byte,complex64,complex128,error,float32,float64,%
int,int8,int16,int32,int64,rune,string,%
uint,uint8,uint16,uint32,uint64,uintptr},
% Constants and zero value
morekeywords=[4]{true,false,iota,nil},
% Strings : "foo", 'bar', `baz`
morestring=[b]{"},
morestring=[b]{'},
morestring=[b]{`},
% Comments : /* comment */ and // comment
comment=[l]{//},
morecomment=[s]{/*}{*/},
% Options
sensitive=true
}
\endinput