annotate test.td @ 156:2c5a8061aa4a

Made some tests dmd-compatible
author Anders Johnsen <skabet@gmail.com>
date Mon, 21 Jul 2008 22:13:12 +0200
parents da551f90e03f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
53
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
1
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
2
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
3
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
4 int main()
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
5 {
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
6 int y = 4;
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
7
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
8 karina k;
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
9
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
10
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
11 while (y > 0)
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
12 y = y - 1;
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
13
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
14 return x;
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
15 }
1
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
16
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
17 int x = 4;
2168f4cb73f1 First push
johnsen@johnsen-desktop
parents:
diff changeset
18
53
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
19
34
5a1a752b3068 Structs!
Anders Johnsen <skabet@gmail.com>
parents: 28
diff changeset
20 struct karina
28
69464d465284 Now supporting structs - both read and write. Still a few errors though, so watch out.
Anders Johnsen <skabet@gmail.com>
parents: 24
diff changeset
21 {
53
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
22 anders a;
34
5a1a752b3068 Structs!
Anders Johnsen <skabet@gmail.com>
parents: 28
diff changeset
23 int age;
5a1a752b3068 Structs!
Anders Johnsen <skabet@gmail.com>
parents: 28
diff changeset
24 int width;
5a1a752b3068 Structs!
Anders Johnsen <skabet@gmail.com>
parents: 28
diff changeset
25 int height;
5a1a752b3068 Structs!
Anders Johnsen <skabet@gmail.com>
parents: 28
diff changeset
26 int lovers;
28
69464d465284 Now supporting structs - both read and write. Still a few errors though, so watch out.
Anders Johnsen <skabet@gmail.com>
parents: 24
diff changeset
27 }
53
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
28 struct anders
22
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 21
diff changeset
29 {
53
da551f90e03f Added struct decl and forward ref. A note on structs: they need to make a new scope when declared. Otherwise you could access struct members as globals
Anders Johnsen <skabet@gmail.com>
parents: 37
diff changeset
30 int hej;
22
e331e4e816e4 now handling structs to some extend
johnsen@johnsen-laptop
parents: 21
diff changeset
31 }