Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / base_init_linext.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 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 kernel
18
19 class A
20 init do
21 'A'.output
22 ' '.output
23 end
24 init inita do init
25 fun work do '\n'.output
26 end
27
28 class B
29 super A
30 init do
31 'B'.output
32 '1'.output
33 ' '.output
34 super
35 'B'.output
36 '2'.output
37 ' '.output
38 end
39 init initb do init
40 end
41
42 class C
43 super A
44 init do
45 'C'.output
46 '1'.output
47 ' '.output
48 super
49 'C'.output
50 '2'.output
51 ' '.output
52 end
53 init initc do init
54 end
55
56 class D
57 super B
58 super C
59 init do
60 'D'.output
61 '1'.output
62 ' '.output
63 super
64 'D'.output
65 '2'.output
66 ' '.output
67 end
68
69 init inite do
70 'E'.output
71 '1'.output
72 ' '.output
73 inita
74 'E'.output
75 '2'.output
76 ' '.output
77 initb
78 'E'.output
79 '3'.output
80 ' '.output
81 initc
82 'E'.output
83 '4'.output
84 ' '.output
85 end
86 end
87
88 #alt0#(new A).work
89 #alt0#(new B).work
90 #alt0#(new C).work
91 (new D).work
92 #alt0#(new D.inite).work