doc/manual: put back the manual in the main repository
[nit.git] / doc / manual / nitlanguage.sty
1 % This file is part of Nit ( http://www.nitlanguage.org ).
2 %
3 % Copyright 2011 Jean Privat <jean@pryen.org>
4 %
5 % Licensed under the Apache License, Version 2.0 (the "License");
6 % you may not use this file except in compliance with the License.
7 % You may obtain a copy of the License at
8 %
9 %     http://www.apache.org/licenses/LICENSE-2.0
10 %
11 % Unless required by applicable law or agreed to in writing, software
12 % distributed under the License is distributed on an "AS IS" BASIS,
13 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 % See the License for the specific language governing permissions and
15 % limitations under the License.
16
17 \usepackage{lmodern} % because there is a bizarre 'pdfTeX error (font expansion): auto expansion is only possible with scalable fonts' unless
18 \usepackage{listings} % because we extends it
19 \usepackage{xcolor} % because we like colors
20
21 % definition of the nit language
22 \lstdefinelanguage{nit}{%
23 keywords={import,class,interface,universal,super,fun,var,redef,protected,private,module,init,do,end,new,%
24                 return,if,then,else,while,for,loop,in,isa,isset,break,continue,label,%
25                 is,abstract,self,true,false,null,nullable,writable,assert,and,or,not,extern,intern},%
26 morecomment=[l]{\#},%
27 morestring=[b]",%
28 }
29
30 % disable spaces ij strings by default
31 \lstset{showstringspaces=false}
32
33 % easy nice environement for nit listings
34 %\lstnewenvironment{lst}[1][]{%
35         \lstset{basicstyle=\scriptsize\ttfamily,%
36         keywordstyle=\bf\color{blue!30!black},%
37         commentstyle=\itshape\color{green!30!black},%
38         language=nit,%
39         backgroundcolor=\color{black!10},%
40         moredelim=[is][\color{yellow!30!black}]{@}{@},%
41 tabsize=3}%,%
42 %       #1}}{}
43
44 % makes @ a nice shortcut for inline Nit code
45 %\lstMakeShortInline[basicstyle=\small\ttfamily\color{blue!30!black}]{@}