Lines Matching refs:nch
520 const struct roff_node *nch;
526 nch = mdoc->last->last;
527 if (nch == NULL || nch->type != ROFFT_TEXT)
529 lc = strchr(nch->string, '\0') - 1;
530 if (lc < nch->string)
539 mandoc_msg(MANDOCERR_DELIM, nch->line,
540 nch->pos + (int)(lc - nch->string), "%s%s %s", roff_name[tok],
541 nch == mdoc->last->child ? "" : " ...", nch->string);
547 const struct roff_node *nch;
559 nch = mdoc->last->last;
560 if (nch == NULL || nch->type != ROFFT_TEXT)
562 lc = strchr(nch->string, '\0') - 1;
563 if (lc <= nch->string)
574 if (lc > nch->string + 1 && lc[-2] == '\\' &&
581 for (cp = lc; cp >= nch->string; cp--)
586 if (lc > nch->string + 1 && lc[-2] == '.' && lc[-1] == '.')
600 for (cp = lc; cp >= nch->string; cp--)
605 if (lc == nch->string + 1 && lc[-1] == '|')
612 if (lc == nch->string + 1 && !isalnum((unsigned char)lc[-1]))
619 for (cp = lc - 1; cp >= nch->string; cp--) {
622 if (cp > nch->string && cp[-1] == ',')
632 mandoc_msg(MANDOCERR_DELIM_NB, nch->line,
633 nch->pos + (int)(lc - nch->string), "%s%s %s", roff_name[tok],
634 nch == mdoc->last->child ? "" : " ...", nch->string);
1082 struct roff_node *n, *nch;
1086 nch = n->child;
1087 assert(nch->type == ROFFT_TEXT);
1089 if ((p = mdoc_a2st(nch->string)) == NULL) {
1091 nch->line, nch->pos, "St %s", nch->string);
1096 nch->flags |= NODE_NOPRT;
1098 roff_word_alloc(mdoc, nch->line, nch->pos, p);
1107 struct roff_node *nch; /* The first child of the .Tg node. */
1123 nt = nch = n->child;
1124 if (nch == NULL && nn != NULL && nn->child != NULL &&
1141 if (nch != NULL && nch->next != NULL) {
1142 mandoc_msg(MANDOCERR_ARG_EXCESS, nch->next->line,
1143 nch->next->pos, "Tg ... %s", nch->next->string);
1144 while (nch->next != NULL)
1145 roff_node_delete(mdoc, nch->next);
1250 struct roff_node *np, *nch;
1266 nch = np->child;
1268 if (nch == NULL) {
1273 nch = nch->next;
1275 if (nch != NULL)
1277 nch->line, nch->pos, "Bf ... %s", nch->string);
1314 struct roff_node *n, *nch;
1319 nch = n->child;
1320 cp = nch->string;
1334 mandoc_msg(MANDOCERR_FN_PAREN, nch->line, nch->pos + pos, "%s", cp);
1534 struct roff_node *n, *nch;
1538 nch = n->child;
1547 if (nch != NULL && ((att = mdoc_a2att(nch->string)) == NULL))
1549 nch->line, nch->pos, "At %s", nch->string);
1553 roff_word_alloc(mdoc, nch->line, nch->pos, att);
1554 nch->flags |= NODE_NOPRT;
1564 struct roff_node *np, *nch;
1569 nch = np->child;
1571 if (nch == NULL)
1576 } else if (nch != NULL)
1578 nch->line, nch->pos, "An ... %s", nch->string);
1712 struct roff_node *nbl, *nit, *nch;
1746 if ((nch = nit->head->child) != NULL)
1749 nch->type == ROFFT_TEXT ? nch->string :
1750 roff_name[nch->tok]);
1766 for (nch = nit->child; nch != NULL; nch = nch->next) {
1767 if (nch->type != ROFFT_BODY)
1769 if (i++ && nch->flags & NODE_LINE)
1771 nch->line, nch->pos, "Ta");
1850 struct roff_node *nbl, *nh, *nch, *nnext;
1858 if ((nch = nh->child) == NULL)
1861 nch->line, nch->pos, "Bl ... %s", nch->string);
1862 while (nch != NULL) {
1863 roff_node_delete(mdoc, nch);
1864 nch = nh->child;
1893 for (nch = nh->child; nch != NULL; nch = nch->next)
1901 for (nch = nh->child; nch != NULL; nch = nnext) {
1902 argv->value[i++] = nch->string;
1903 nch->string = NULL;
1904 nnext = nch->next;
1905 roff_node_delete(NULL, nch);
2049 struct roff_node *nch;
2051 nch = mdoc->last->child;
2053 if (nch == NULL) {
2058 assert(nch->type == ROFFT_TEXT);
2060 if ( ! strcmp(nch->string, "on")) {
2064 if ( ! strcmp(nch->string, "off")) {
2069 mandoc_msg(MANDOCERR_SM_BAD, nch->line, nch->pos,
2070 "%s %s", roff_name[mdoc->last->tok], nch->string);
2071 roff_node_relink(mdoc, nch);
2136 struct roff_node *np, *nch, *next, *prev;
2156 for (nch = np->child->next; nch != NULL; nch = next) {
2159 if (rsord[i] == nch->tok)
2163 mandoc_msg(MANDOCERR_RS_BAD, nch->line, nch->pos,
2164 "%s", roff_name[nch->tok]);
2166 } else if (nch->tok == MDOC__J || nch->tok == MDOC__B)
2176 if ((next = nch->next) != NULL)
2177 next->prev = nch->prev;
2179 if ((prev = nch->prev) != NULL)
2180 prev->next = nch->next;
2182 nch->prev = nch->next = NULL;
2206 nch->prev = prev;
2209 np->child->prev = nch;
2210 nch->next = np->child;
2211 np->child = nch;
2214 prev->next->prev = nch;
2215 nch->next = prev->next;
2216 prev->next = nch;
2228 struct roff_node *n, *nch;
2232 for (nch = n->child; nch != NULL; nch = nch->next) {
2233 if (nch->type != ROFFT_TEXT)
2235 cp = nch->string;
2243 n->tag = mandoc_strdup(nch->string);
2467 struct roff_node *nch;
2488 (nch = mdoc->last->child) == NULL ? "" :
2489 nch->type == ROFFT_TEXT ? nch->string :
2490 roff_name[nch->tok]);
2511 if ((nch = mdoc->last->child) == NULL ||
2512 nch->type != ROFFT_TEXT || nch->next != NULL)
2517 dist = similar(nch->string, *testsec);
2524 mandoc_msg(MANDOCERR_SEC_TYPO, nch->line, nch->pos,
2525 "Sh %s instead of %s", nch->string, goodsec);
2584 struct roff_node *n, *nch;
2587 nch = n->child;
2588 if (nch->next == NULL) {
2590 n->line, n->pos, "Xr %s", nch->string);
2592 assert(nch->next == n->last);
2593 if(mandoc_xr_add(nch->next->string, nch->string,
2594 nch->line, nch->pos))
2596 nch->line, nch->pos, "Xr %s %s",
2597 nch->string, nch->next->string);
2605 struct roff_node *n, *nch;
2620 if ((nch = n->child) != NULL &&
2621 nch->type == ROFFT_TEXT &&
2622 strcmp(nch->string, tag) == 0)
2636 if ((nch = n->child) != NULL &&
2637 (nch->tok == MDOC_Pp || nch->tok == ROFF_br ||
2638 nch->tok == ROFF_sp)) {
2639 mandoc_msg(MANDOCERR_PAR_SKIP, nch->line, nch->pos,
2640 "%s after %s", roff_name[nch->tok],
2642 roff_node_delete(mdoc, nch);
2644 if ((nch = n->last) != NULL &&
2645 (nch->tok == MDOC_Pp || nch->tok == ROFF_br)) {
2646 mandoc_msg(MANDOCERR_PAR_SKIP, nch->line, nch->pos,
2647 "%s at the end of %s", roff_name[nch->tok],
2649 roff_node_delete(mdoc, nch);
2823 struct roff_node *n, *nch;
2829 nch = n->child;
2831 if (nch != NULL) {
2832 macro = !strcmp(nch->string, "Open") ? "Ox" :
2833 !strcmp(nch->string, "Net") ? "Nx" :
2834 !strcmp(nch->string, "Free") ? "Fx" :
2835 !strcmp(nch->string, "DragonFly") ? "Dx" : NULL;
2839 mdoc->last = nch;
2840 nch = nch->next;
2850 if (nch == NULL) {
2870 *nch->string = (char)toupper((unsigned char)*nch->string);