update NOTICE and LICENSE
[nit.git] / tests / base_var_untyped.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2009 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 fun rand: Bool do return true
20
21 var a
22 #alt1#a.output
23 a = 1
24 (a*10).output
25 a = 2
26 (a*10).output
27 a = false
28 (not a).output
29
30 var b1
31 var b2
32 var b3
33 if rand then
34 b1 = 3
35 b2 = 4
36 b3 = 5
37 else
38 b1 = -3
39 b2 = true
40 end
41 (b1*10).output
42 #alt2#b2.output
43 #alt3#b3.output
44 #alt4#b2 += 1
45
46 var c
47 while rand do
48 c = 4
49 #alt5#c = b2
50 #alt6#c = b3
51 (c*10).output
52 if rand then break
53 end
54 #alt7#c.output
55
56 var d
57 #alt8#d = fail
58 #alt8#d.output