Select Git revision
lst.tex 2.67 KiB
\usepackage{listings}
\usepackage{inconsolata}
\lstdefinestyle{common-style}{
basicstyle=\ttfamily,
morecomment=[s]{<!--}{-->},
commentstyle={\color{gray}},
numbers=left,
numberstyle=\ttfamily,
stepnumber=1,
numbersep=5pt,
showstringspaces=false,
breaklines=true,
frame=lines,
backgroundcolor=\color{background},
autogobble=true,
keywordstyle={\color{blue}\textbf}, % keywords are blue
commentstyle={\color{gray}}, % comments
aboveskip={0.1\baselineskip}
}
\colorlet{punct}{red!60!black}
\definecolor{background}{HTML}{EEEEEE}
\definecolor{delim}{RGB}{20,105,176}
\colorlet{numb}{magenta!60!black}
\lstdefinestyle{shortlisting}{
xleftmargin=\parindent,
frame=none,
aboveskip=3pt,belowskip=3pt
}
\lstdefinestyle{unboxed}{
style=common-style,
frame=none,
}
% JastAdd
\lstdefinelanguage{AST}{
style=common-style,
morekeywords={abstract,rel},
otherkeywords={::=,->,<,>},
morecomment=[l]{//}, morecomment=[s]{/*}{*/},
}
\lstdefinelanguage{JSON}{
style=common-style,
morecomment=[s]{<!--}{-->},
literate=
*{0}{{{\color{numb}0}}}{1}
{1}{{{\color{numb}1}}}{1}
{2}{{{\color{numb}2}}}{1}
{3}{{{\color{numb}3}}}{1}
{4}{{{\color{numb}4}}}{1}
{5}{{{\color{numb}5}}}{1}
{6}{{{\color{numb}6}}}{1}
{7}{{{\color{numb}7}}}{1}
{8}{{{\color{numb}8}}}{1}
{9}{{{\color{numb}9}}}{1}
{:}{{{\color{punct}{:}}}}{1}
{,}{{{\color{punct}{,}}}}{1}
{\{}{{{\color{delim}{\{}}}}{1}
{\}}{{{\color{delim}{\}}}}}{1}
{[}{{{\color{delim}{[}}}}{1}
{]}{{{\color{delim}{]}}}}{1}
{Ö}{{\"O}}1
{Ä}{{\"A}}1
{Ü}{{\"U}}1
{ß}{{\ss}}1
{ü}{{\"u}}1
{ä}{{\"a}}1
{ö}{{\"o}}1,
}
\lstdefinelanguage{JRAG}[]{java}{
style=common-style,
morekeywords={abstract,public,private,boolean,aspect,null,syn,inh,coll,eq,with,int,contributes,new,return,for,if,else,this,to,true,false},
morecomment=[l]{//}, morecomment=[s]{/*}{*/},
}
\newcommand{\lstbg}[3][0pt]{{\fboxsep#1\colorbox{#2}{\strut #3}}}
\lstdefinelanguage{diff}[]{java}{
style=common-style,
morecomment=[f][\lstbg{HKS07!30}]-,
morecomment=[f][\lstbg{HKS65!30}]+,
morecomment=[f][\textit]{@@},
%morecomment=[f][\textit]{---},
%morecomment=[f][\textit]{+++},
}
\lstdefinestyle{AST} { language=AST,style=common-style }
\lstdefinestyle{JRAG} { language=JRAG,style=common-style }
\lstdefinestyle{Java} { language=Java,style=common-style }
\lstdefinestyle{JSON} { language=JSON,style=common-style }
\lstset{
language=C++,
breaklines=true,
frame=single,
basicstyle=\ttfamily,
keywordstyle=\color{blue}\ttfamily,
stringstyle=\color{red}\ttfamily,
commentstyle=\color{blue}\ttfamily,
morecomment=[l][\color{magenta}]{\#},
rulecolor=\color{black},
}