*isfunc = true;
while (true) {
ast_value *param;
+ ast_value *fld;
+ bool isfield = false;
bool dummy;
if (!parser_next(parser))
if (parser->tok == ')')
break;
+ if (parser->tok == '.') {
+ isfield = true;
+ if (!parser_next(parser)) {
+ parseerror(parser, "expected field parameter type");
+ goto on_error;
+ }
+ }
+
temptype = parser_token(parser)->constval.t;
if (!parser_next(parser))
goto on_error;
goto on_error;
}
+ if (isfield) {
+ fld = ast_value_new(ctx, param->name, TYPE_FIELD);
+ fld->expression.next = (ast_expression*)param;
+ param = fld;
+ }
+
if (!paramlist_t_p_add(¶ms, param)) {
parseerror(parser, "Out of memory while parsing typename");
goto on_error;
}
}
+ if (isfunc) {
+ ast_value *fval;
+ fval = ast_value_new(ctx, var->name, TYPE_FUNCTION);
+ if (!fval) {
+ ast_value_delete(var);
+ return false;
+ }
+ fval->expression.next = (ast_expression*)var;
+ MEM_VECTOR_MOVE(&var->expression, params, &fval->expression, params);
+ var = fval;
+ }
+
/* turn it into a field */
fld = ast_value_new(ctx, parser_tokval(parser), TYPE_FIELD);
fld->expression.next = (ast_expression*)var;