]> git.xonotic.org Git - xonotic/gmqcc.git/blob - data/vars.qc
for the lexer 3 dots now become TOKEN_DOTS
[xonotic/gmqcc.git] / data / vars.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 multi, decla, ration;
12 .vector memvec;
13
14 .void(string x) printit;
15
16 float(vector different_name, vector b) dot;
17
18 float(vector a, vector b) dot = {
19     return a * b;
20 };
21
22 void(string x) myprintit = {
23     print3("-> ", x, "\n");
24 };
25
26 void(vector par) vecpar = {
27     // vector-parameters need _x, _y, _z as well
28     print3("par_y should be 5... = ", ftos(par_y), "\n");
29 };
30
31 void() main = {
32     local entity pawn;
33     local vector foovec;
34     print3("should be 1: ", ftos(dot('1 1 0', '1 0 0')), "\n");
35
36     foovec = '3 4 5';
37     foovec_y = 9;
38     pawn = spawn();
39     pawn.printit = myprintit;
40     pawn.printit("Hello");
41
42     vecpar('1 5 9');
43 };