+ for (nn = man->last->parent; nn; nn = nn->parent)
+ if (nn->tok == ntok && nn->type == ROFFT_BLOCK)
+ nrew++;
+ target = strtol(p, &ep, 10);
+ if (*ep != '\0')
+ mandoc_msg(MANDOCERR_ARG_EXCESS, line,
+ la + (buf[la] == '"') + (int)(ep - p),
+ "RE ... %s", ep);
+ free(p);
+ if (target == 0)
+ target = 1;
+ nrew -= target;
+ if (nrew < 1) {
+ mandoc_msg(MANDOCERR_RE_NOTOPEN,
+ line, ppos, "RE %d", target);
+ return;
+ }
+ break;
+ case MAN_YS:
+ ntok = MAN_SY;
+ break;
+ case MAN_UE:
+ ntok = MAN_UR;
+ break;
+ case MAN_ME:
+ ntok = MAN_MT;
+ break;
+ default:
+ abort();
+ }
+
+ for (nn = man->last->parent; nn; nn = nn->parent)
+ if (nn->tok == ntok && nn->type == ROFFT_BLOCK && ! --nrew)
+ break;
+
+ if (nn == NULL) {
+ mandoc_msg(MANDOCERR_BLK_NOTOPEN,
+ line, ppos, "%s", roff_name[tok]);
+ rew_scope(man, MAN_PP);
+ if (tok == MAN_RE) {
+ roff_elem_alloc(man, line, ppos, ROFF_br);
+ man->last->flags |= NODE_LINE |
+ NODE_VALID | NODE_ENDED;
+ man->next = ROFF_NEXT_SIBLING;
+ }
+ return;
+ }
+
+ cline = man->last->line;
+ cpos = man->last->pos;
+ ctok = man->last->tok;
+ man_unscope(man, nn);
+
+ if (tok == MAN_RE && nn->head->aux > 0)
+ roff_setreg(man->roff, "an-margin", nn->head->aux, '-');
+
+ /* Trailing text. */
+
+ if (buf[*pos] != '\0') {
+ roff_word_alloc(man, line, ppos, buf + *pos);
+ man->last->flags |= NODE_DELIMC;
+ if (mandoc_eos(man->last->string, strlen(man->last->string)))
+ man->last->flags |= NODE_EOS;