--- /dev/null
+/* this is the WIP test for the parser...
+ * constantly adding stuff here to see if things break
+ */
+void(string) print = #1;
+void(string,string) print2 = #1;
+void(string,string,string) print3 = #1;
+string(float) ftos = #2;
+entity() spawn = #3;
+void(entity) kill = #4;
+
+float(vector different_name, vector b) dot;
+
+float(vector a, vector b) dot = {
+ return a * b;
+};
+
+void() main = {
+ print3("should be 1: ", ftos(dot('1 1 0', '1 0 0')), "\n");
+};
* messing with the parameter-vector etc. earlier
*/
if (proto) {
+ size_t param;
if (!ast_compare_type((ast_expression*)proto, (ast_expression*)fval)) {
parseerror(parser, "conflicting types for `%s`, previous declaration was here: %s:%i",
proto->name,
ast_value_delete(fval);
return false;
}
+ /* copy over the parameter names */
+ for (param = 0; param < fval->expression.params_count; ++param)
+ ast_value_set_name(proto->expression.params[param], fval->expression.params[param]->name);
+
+ /* now ditch the rest of the new data */
ast_function_delete(func);
ast_value_delete(fval);
fval = proto;