syntax: 'meth' -> 'fun', 'attr' -> 'var'
[nit.git] / tests / module_1.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2004-2008 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 import module_0
18
19 class A # class 1
20 fun a1
21 do
22 print(1)
23 print(1)
24 end
25 fun a12
26 do
27 print(12)
28 print(1)
29 end
30 fun a13
31 do
32 print(13)
33 print(1)
34 end
35 fun a123
36 do
37 print(123)
38 print(1)
39 end
40 end
41
42 class B # class 2
43 special A
44 redef fun a12
45 do
46 print(12)
47 print(2)
48 end
49 redef fun a123
50 do
51 print(123)
52 print(2)
53 end
54 fun all2
55 do
56 a1
57 a12
58 a13
59 a123
60 end
61 fun all25
62 do
63 print(250)
64 print(2)
65 a1
66 a12
67 a13
68 a123
69 end
70 end