- for (j = 0; j < set->val->vars->count; ++j) {
- decl_var *set_var = set->val->vars->vars[j];
-
- check = 0;
- if (impl->decl->args) {
- for (k = 0; k < impl->decl->args->count; ++k) {
- decl_arg *set_arg = impl->decl->args->args[k];
-
- if (!strcmp(set_var->name, set_arg->var->name)) {
- check = 1;
- set_var->arg = set_arg;
- if (!validate_set_value(data, set->val, 1, &set_arg, 1, &impl->decl->func, impl->decl->args->count, impl->decl->args->args, 0)) {
- return 0;
- }
- break;
- }
- }
- }
- if (!check) {
- for (k = 0; k < impl->stmts->let.count; ++k) {
- let_stmt *let = impl->stmts->let.list[k];
-
- /* check temp vars */
- if (let->val && let->val->kind == PSI_LET_TMP) {
- if (!strcmp(set_var->name, let->val->var->name)) {
- check = 1;
- set_var->arg = let->val->var->arg;
- if (!validate_set_value(data, set->val, 1, &set_var->arg, 1, &impl->decl->func, impl->decl->args->count, impl->decl->args->args, 0)) {
- return 0;
- }
- break;
- }
- }
+ switch (set->exp->kind) {
+ case PSI_SET_NUMEXP:
+ break;
+ case PSI_SET_FUNC:
+ if (!psi_decl_get_arg(impl->decl, set->exp->data.func->var)) {
+ if (!psi_impl_get_temp_let_arg(impl, set->exp->data.func->var)) {
+ data->error(data, set->token, PSI_WARNING,
+ "Unknown variable '%s' of `set` statement of implementation '%s'",
+ set->exp->data.func->var, impl->func->name);
+ return false;