From 0afdba6c59a2a26d51241398bce6a84242dafe23 Mon Sep 17 00:00:00 2001 From: Wandmalfarbe Date: Sun, 4 Aug 2019 16:30:09 +0200 Subject: [PATCH] Update listings definition for Java which is the default language when using listings. --- eisvogel.tex | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/eisvogel.tex b/eisvogel.tex index 3b9e045..4232340 100644 --- a/eisvogel.tex +++ b/eisvogel.tex @@ -711,6 +711,44 @@ $endif$ } \lstset{style=eisvogel_listing_style} +% +% Java (Java SE 12, 2019-06-22) +% +\lstdefinelanguage{Java}{ + morekeywords={ + % normal keywords (without data types) + abstract,assert,break,case,catch,class,continue,default, + do,else,enum,exports,extends,final,finally,for,if,implements, + import,instanceof,interface,module,native,new,package,private, + protected,public,requires,return,static,strictfp,super,switch, + synchronized,this,throw,throws,transient,try,volatile,while, + % var is an identifier + var + }, + morekeywords={[2] % data types + % primitive data types + boolean,byte,char,double,float,int,long,short, + % String + String, + % primitive wrapper types + Boolean,Byte,Character,Double,Float,Integer,Long,Short + % number types + Number,AtomicInteger,AtomicLong,BigDecimal,BigInteger,DoubleAccumulator,DoubleAdder,LongAccumulator,LongAdder,Short, + % other + Object,Void,void + }, + morekeywords={[3] % literals + % reserved words for literal values + null,true,false, + }, + sensitive, + morecomment = [l]//, + morecomment = [s]{/*}{*/}, + morecomment = [s]{/**}{*/}, + morestring = [b]", + morestring = [b]', +} + \lstdefinelanguage{XML}{ morestring = [b]", moredelim = [s][\bfseries\color{listing-keyword}]{<}{\ },