blob: 8426fbb308730dea006998e0c981d40d717624c1 (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
echo("special variable inheritance");
module special_module(a) {
echo(a, $fn);
special_module2(a);
}
module special_module2(b) {
echo(a);
echo(b, $fn);
}
special_module(23, $fn=5);
echo("inner variables shadows parameter");
module inner_variables(a, b) {
b = 24;
echo(a, b);
}
inner_variables(5, 6);
echo("user-defined special variables as parameter");
module user_defined_special($b) {
echo($b);
user_defined_special2();
}
module user_defined_special2() {
echo($b);
}
user_defined_special(7);
echo("assign only visible in children's scope");
module assigning() {
echo(c);
}
module assigning2(c) {
echo(c);
}
assign(c=5) {
assigning();
assigning2(c);
}
echo("undeclared variable can still be passed and used");
module undeclared_var() {
echo(d);
}
undeclared_var(d=6);
|