Parse - Bring in type and variable naming rules
[rune.git] / tests / typeof.d
1 #!/usr/local/bin/rune
2 #
3 #       Demonstrate typeof in a simple switch
4 #
5
6 import "sys" as self;
7 import "stdio" as Stdio;
8
9 alias Stdio.File *stdout = Stdio.stdout;
10
11 int
12 main(int ac, char **av)
13 {
14         int x = 4;
15
16         switch(typeof(int)) {
17         case typeof(char):
18                 Stdio.puts("type is char");
19                 break;
20         case typeof(int):
21                 Stdio.puts("type is int");
22                 break;
23         default:
24                 Stdio.puts("No clue");
25                 break;
26         }
27 }
28