langs.sty
changeset 254 dcd4688690ce
parent 242 35104ee14f87
child 272 1446bc47a294
--- a/langs.sty	Sun Sep 21 17:40:04 2014 +0100
+++ b/langs.sty	Sun Sep 21 23:23:43 2014 +0100
@@ -20,15 +20,15 @@
     private,protected,requires,return,sealed,%
     super,this,throw,trait,true,try,%
     type,val,var,while,with,yield},%
-  otherkeywords={=>,<-,<\%,<:,>:,\#,@},%
+  otherkeywords={=>,<-,<\%,<:,>:,\#},%
   sensitive=true,%
   %directives={Int,Char,Rexp,String,Boolean,BigInt,Unit,List,Set},%
   %moredelim=*[directive]:,%
   morecomment=[l]{//},%
   morecomment=[n]{/*}{*/},
+  morestring=[s]{"""}{"""},
   morestring=[b]",
   morestring=[b]',
-  morestring=[b]"""
 }[keywords,comments,strings]
 
 \lstdefinelanguage{While}{
@@ -41,7 +41,6 @@
 \lstdefinestyle{mystyle}
        {basicstyle=\ttfamily,
 	keywordstyle=\color{codepurple}\bfseries,
-        %directivestyle=\color{codeblue}\bfseries,
 	stringstyle=\color{codegreen},
 	commentstyle=\color{codegreen},
 	morecomment=[s][\color{codedocblue}]{/**}{*/},
@@ -54,7 +53,8 @@
 	showstringspaces=false,
         xleftmargin=8mm,
         emphstyle=\color{codeblue}\bfseries,
-        keepspaces}
+        keepspaces
+}
 
 \lstset{language=Scala,
         style=mystyle}
@@ -62,4 +62,5 @@
 
 \newcommand{\code}[1]{{\lstinline{#1}}}
 \newcommand{\pcode}[1]{\mbox{\lstset{language={},keywordstyle=\color{black}}\lstinline!#1!}}
+\newcommand{\scode}[1]{\mbox{\lstset{language={},basicstyle=\ttfamily\color{codegreen}}\lstinline!#1!}}
 \makeatother