]> de.git.xonotic.org Git - xonotic/gmqcc.git/blob - data/vars.qc
Creating the ast_function for a function only when encountering its body, so if no...
[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
13 .void(string x) printit;
14
15 float(vector different_name, vector b) dot;
16
17 float(vector a, vector b) dot = {
18     return a * b;
19 };
20
21 void(string x) myprintit = {
22     print3("-> ", x, "\n");
23 };
24
25 void(vector par) vecpar = {
26     // vector-parameters need _x, _y, _z as well
27     print3("par_y should be 5... = ", ftos(par_y), "\n");
28 };
29
30 void() main = {
31     local entity pawn;
32     print3("should be 1: ", ftos(dot('1 1 0', '1 0 0')), "\n");
33
34     pawn = spawn();
35     pawn.printit = myprintit;
36     pawn.printit("Hello");
37
38     vecpar('1 5 9');
39 };