update NOTICE and LICENSE
[nit.git] / tests / base_var2.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 array
18
19 fun foo(p1: Int)
20 do
21 var a1: Int = p1 + 1
22 #alt1#var p1: Int = a1 + 2
23 p1.output
24 a1.output
25 end
26
27 #alt9#fun bar(p1: Int, p1: Int) do p1.output
28
29 foo(0)
30 var a1: Int = 10
31 do
32 var a2: Int = 11
33 #alt2#var a1: Int = 12
34 a1.output
35 a2.output
36 end
37 #alt3#var a1: Int = 13
38 a1.output
39 for a3 in [30, 31] do
40 var a2: Int = 20
41 #alt4#var a1: Int = 1
42 #alt5#var a3: Int = 1
43 a1.output
44 a2.output
45 a3.output
46 #alt6#for a2 in [400, 500] do a2.output
47 end
48 var a2: Int = 40
49 a1.output
50 a2.output
51 #alt7#a3.output
52 #alt8#p1.output