]> git.xonotic.org Git - xonotic/gmqcc.git/blob - data/parsing.qc
clear all the remaining vectors in the parser
[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 $framevalue 0
15 $frame stand1 stand2 standX
16 $framerestore stand2
17 $frame stand3
18 $modelname foobar
19 $modelname foobar3
20
21 void() main = {
22     entity pawn;
23     vector vec;
24     float a;
25
26     vec = '3 4 5';
27     vec_z = 5;
28
29     a = 5;
30
31     if (a) {
32         print("a != 0\n");
33     } else {
34         print("not a\n");
35     }
36
37     a = 19;
38     print("Hello, World\n");
39
40     pawn = spawn();
41     pawn.mema = 3;
42     pawn.memb = 5;
43     print2(ftos(pawn.mema), "\n");
44     print2(ftos(pawn.memb), "\n");
45
46     print("SECOND TEST\n");
47     for (a = 0; a < 3; a = a + 1) {
48         print3("LOOP ", ftos(a), "\n");
49     }
50
51     print("DO-WHILE test\n");
52     a = 2;
53     do {
54         print("Foo\n");
55         a = a - 1;
56     } while (a);
57
58     float b;
59     a = 5;
60     print3("a = ", ftos(a), "\n");
61     b = a += 7;
62     print("adding\n");
63     print3("a = ", ftos(a), "\n");
64     print3("b = ", ftos(a), "\n");
65
66     print3("memb = ", ftos(pawn.memb), "\n");
67     pawn.memb += -1;
68     print3("memb = ", ftos(pawn.memb), "\n");
69     print3("Frame stand3 is ", ftos($stand3), " wooh\n");
70 };