+}
+
+bool psi_decl_enum_item_validate(struct psi_data *data,
+ struct psi_decl_enum *enm, struct psi_decl_enum_item *item, size_t seq)
+{
+ struct psi_validate_scope scope = {0};
+
+ if (!item->num) {
+ if (seq) {
+ int64_t one = 1;
+
+ item->inc.op = PSI_T_PLUS;
+ item->inc.data.b.lhs = psi_num_exp_init_unary(PSI_T_LPAREN,
+ psi_num_exp_copy(item->prev->num));
+ item->inc.data.b.rhs = psi_num_exp_init_num(
+ psi_number_init(PSI_T_INT64, &one, 0));
+ item->num = &item->inc;
+ } else {
+ int64_t nil = 0;
+
+ item->inc.op = PSI_T_NUMBER;
+ item->inc.data.n = psi_number_init(PSI_T_INT64, &nil, 0);
+ item->num = &item->inc;
+ }
+ }
+
+ scope.current_enum = enm;
+ if (!psi_num_exp_validate(data, item->num, &scope)) {
+ return false;
+ }
+
+ item->val = psi_num_exp_get_long(item->num, NULL, NULL);
+
+ return true;