summaryrefslogtreecommitdiff
path: root/test/colm.d/scope1.lm
blob: d2523ff810fb63e873682d548cfe24dc7e964ea9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
int f()
{
	i: int = 0
	j: int = 100

	while i < 4 {
		j: int = 200
		if ( i < 1 ) {
			j: int = 300
			print( "i: [$i] j: [$j]\n" )
		}
		elsif ( i < 2 ) {
			j: int = 300
			print( "i: [$i] j: [$j]\n" )
		}
		elsif ( i < 3 ) {
			print( "i: [$i] j: [$j]\n" )
		}
		else {
			print( "i: [$i] j: [$j]\n" )
		}

		i = i + 1
	}

	print( "j: [$j]\n" )
}

f()
##### EXP #####
i: 0 j: 300
i: 1 j: 300
i: 2 j: 200
i: 3 j: 200
j: 100