-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrascallst.sty
48 lines (39 loc) · 1.55 KB
/
rascallst.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
39
40
41
42
43
44
45
46
47
48
\ProvidesPackage{rascallst}
\RequirePackage{listings}
\RequirePackage{xspace}
\lstdefinelanguage{rascal}{%
% numbers=left,%
morekeywords={try,value,catch,module,when,solve,with,import,alias,str,if,loc,else,switch,visit,case,default,break,throw,int,real,bag,data,rule,for,bool,insert,public,return,private,void,map,:,<,>,@,(,),=,:=,==,.,+=,-=,*=,/=,~=,rel,list,set,tuple,[,],anno},
sensitive=true,%
morecomment=[l]{//},%
morestring=[b]",%
commentstyle=\footnotesize\ttfamily\itshape,%
keywordstyle=\bfseries,%
basicstyle=\footnotesize\ttfamily,%
showstringspaces=false,%
% columns=flexible,%
escapeinside={(*@}{@*)},%
literate={<-}{{\,$\leftarrow$}\,}1 {=>}{{\,$\Rightarrow$}\,}1 {:}{\textbf{:}}1,%
}
\lstdefinelanguage{rascalnocase}{%
% numbers=left,%
morekeywords={try,value,catch,module,when,solve,with,import,alias,str,if,else,visit,break,throw,int,real,bag,data,rule,for,bool,insert,public,return,private,void,map,:,<,>,(,),=,:=,==,.,+=,-=,*=,/=,~=,rel,list,set,tuple,[,]},
sensitive=true,%
morecomment=[l]{//},%
morestring=[b]",%
commentstyle=\footnotesize\ttfamily\itshape,%
keywordstyle=\bfseries,%
basicstyle=\footnotesize\ttfamily,%
showstringspaces=false,%
% columns=flexible,%
escapeinside={(*@}{@*)},%
literate={<-}{{\,$\leftarrow$}\,}1 {=>}{{\,$\Rightarrow$}\,}1 {:}{\textbf{:}}1,%
}
%{&&}{\,$\wedge$\,}1 {||}{\,$\vee$\,}1
\newcommand{\keyword}[1]{\textbf{\textrm{#1}}\xspace}
\newcommand{\rascal}[1]{\lstinline[language=rascal]{#1}}
\newcommand{\rsnippet}[1]{\textrm{\small #1}}
\newcommand{\code}[1]{\rsnippet{#1}}
\lstset{%
language=rascal%
}