]> git.xonotic.org Git - xonotic/gmqcc.git/blob - data/parsing.qc
+= operator implemented
[xonotic/gmqcc.git] / data / parsing.qc
1 /* this is the WIP test for the parser...
2  * constantly adding stuff here to see if things break
3  */
4 void(string)        print  = #1;
5 void(string,string) print2 = #1;
6 void(string,string,string) print3 = #1;
7 string(float)       ftos   = #2;
8 entity()            spawn  = #3;
9 void(entity)        kill   = #4;
10
11 .float mema;
12 .float memb;
13
14 void() main = {
15     entity pawn;
16     vector vec;
17     float a;
18
19     vec = '3 4 5';
20     vec_z = 5;
21
22     a = 5;
23
24     if (a) {
25         print("a != 0\n");
26     } else {
27         print("not a\n");
28     }
29
30     a = 19;
31     print("Hello, World\n");
32
33     pawn = spawn();
34     pawn.mema = 3;
35     pawn.memb = 5;
36     print2(ftos(pawn.mema), "\n");
37     print2(ftos(pawn.memb), "\n");
38
39     print("SECOND TEST\n");
40     for (a = 0; a < 3; a = a + 1) {
41         print3("LOOP ", ftos(a), "\n");
42     }
43
44     print("DO-WHILE test\n");
45     a = 2;
46     do {
47         print("Foo\n");
48         a = a - 1;
49     } while (a);
50
51     float b;
52     a = 5;
53     print3("a = ", ftos(a), "\n");
54     b = (a += 7);
55     print("adding\n");
56     print3("a = ", ftos(a), "\n");
57     print3("b = ", ftos(a), "\n");
58 };