blob: 41f30815ba5b29795b05f305d5ab7ba62bc095ed (
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
|
BEGIN {
if (0)
printf("nothing");
@var = 0;
if (@var)
printf("not printed\n");
if (1) {
printf("printed!\n");
}
if (0)
printf("simple if\n");
else
printf("simple else\n");
if (0) {
printf("disabled if\n");
} else if (1) {
printf("multiple statements in ");
printf("else-if branch\n");
} else {
printf("no else\n");
}
}
END {
if (42) {
printf("multiple ");
@var = 4;
printf("(%d) ", @var);
printf("statements\n");
}
if (0) printf("single-line if\n"); else printf("single-line else\n");
if (0) {
printf("not printed\n");
} else {
if (0) {
printf("nested not printed\n");
} else {
printf("nested printed\n");
exit();
printf("nested not printed\n");
}
printf("also not printed\n");
}
}
|