- case PSI_T_NAME:
- if (current_enum && psi_num_exp_validate_enum(data, exp, current_enum)) {
- return true;
- }
- while (psi_plist_get(data->enums, i++, &enm)) {
- if (psi_num_exp_validate_enum(data, exp, enm)) {
- return true;
- }
- }
- if (exp->data.dvar->arg) {
- return true;
- }
- if (psi_decl_var_validate(data, exp->data.dvar, impl ? impl->decl : NULL,
- current_let, current_set)) {
- return true;
- }
- if (cb_decl && psi_decl_var_validate(data, exp->data.dvar, cb_decl, NULL, NULL)) {
- return true;
- }
- data->error(data, exp->token, PSI_WARNING,
- "Unknown variable '%s' in numeric expression",
- exp->data.dvar->name);
- return false;
-
- case PSI_T_NSNAME:
- while (psi_plist_get(data->consts, i++, &cnst)) {
- if (!strcmp(cnst->name, exp->data.numb)) {
- free(exp->data.numb);
- exp->type = PSI_T_CONST;
- exp->data.cnst = cnst;
- return true;
- }
- }
- data->error(data, exp->token, PSI_WARNING,
- "Unknown constant '%s' in numeric expression",
- exp->data.numb);
- return false;
+ case PSI_T_CAST:
+ return psi_num_exp_validate(data, exp->data.c.num, scope)
+ && psi_decl_type_validate(data, exp->data.c.typ, NULL, scope);
+ break;