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. */
1124 nt = nch = n->child;
1125 if (nch == NULL && nn != NULL && nn->child != NULL &&
1142 if (nch != NULL && nch->next != NULL) {
1143 mandoc_msg(MANDOCERR_ARG_EXCESS, nch->next->line,
1144 nch->next->pos, "Tg ... %s", nch->next->string);
1145 while (nch->next != NULL)
1146 roff_node_delete(mdoc, nch->next);
1251 struct roff_node *np, *nch;
1267 nch = np->child;
1269 if (nch == NULL) {
1274 nch = nch->next;
1276 if (nch != NULL)
1278 nch->line, nch->pos, "Bf ... %s", nch->string);
1315 struct roff_node *n, *nch;
1320 nch = n->child;
1321 cp = nch->string;
1335 mandoc_msg(MANDOCERR_FN_PAREN, nch->line, nch->pos + pos, "%s", cp);
1532 struct roff_node *n, *nch;
1536 nch = n->child;
1545 if (nch != NULL && ((att = mdoc_a2att(nch->string)) == NULL))
1547 nch->line, nch->pos, "At %s", nch->string);
1551 roff_word_alloc(mdoc, nch->line, nch->pos, att);
1552 nch->flags |= NODE_NOPRT;
1562 struct roff_node *np, *nch;
1567 nch = np->child;
1569 if (nch == NULL)
1574 } else if (nch != NULL)
1576 nch->line, nch->pos, "An ... %s", nch->string);
1710 struct roff_node *nbl, *nit, *nch;
1744 if ((nch = nit->head->child) != NULL)
1747 nch->type == ROFFT_TEXT ? nch->string :
1748 roff_name[nch->tok]);
1764 for (nch = nit->child; nch != NULL; nch = nch->next) {
1765 if (nch->type != ROFFT_BODY)
1767 if (i++ && nch->flags & NODE_LINE)
1769 nch->line, nch->pos, "Ta");
1892 struct roff_node *nbl, *nh, *nch, *nnext;
1900 if ((nch = nh->child) == NULL)
1903 nch->line, nch->pos, "Bl ... %s", nch->string);
1904 while (nch != NULL) {
1905 roff_node_delete(mdoc, nch);
1906 nch = nh->child;
1935 for (nch = nh->child; nch != NULL; nch = nch->next)
1943 for (nch = nh->child; nch != NULL; nch = nnext) {
1944 argv->value[i++] = nch->string;
1945 nch->string = NULL;
1946 nnext = nch->next;
1947 roff_node_delete(NULL, nch);
2091 struct roff_node *nch;
2093 nch = mdoc->last->child;
2095 if (nch == NULL) {
2100 assert(nch->type == ROFFT_TEXT);
2102 if ( ! strcmp(nch->string, "on")) {
2106 if ( ! strcmp(nch->string, "off")) {
2111 mandoc_msg(MANDOCERR_SM_BAD, nch->line, nch->pos,
2112 "%s %s", roff_name[mdoc->last->tok], nch->string);
2113 roff_node_relink(mdoc, nch);
2178 struct roff_node *np, *nch, *next, *prev;
2198 for (nch = np->child->next; nch != NULL; nch = next) {
2201 if (rsord[i] == nch->tok)
2205 mandoc_msg(MANDOCERR_RS_BAD, nch->line, nch->pos,
2206 "%s", roff_name[nch->tok]);
2208 } else if (nch->tok == MDOC__J || nch->tok == MDOC__B)
2218 if ((next = nch->next) != NULL)
2219 next->prev = nch->prev;
2221 if ((prev = nch->prev) != NULL)
2222 prev->next = nch->next;
2224 nch->prev = nch->next = NULL;
2248 nch->prev = prev;
2251 np->child->prev = nch;
2252 nch->next = np->child;
2253 np->child = nch;
2256 prev->next->prev = nch;
2257 nch->next = prev->next;
2258 prev->next = nch;
2270 struct roff_node *n, *nch;
2274 for (nch = n->child; nch != NULL; nch = nch->next) {
2275 if (nch->type != ROFFT_TEXT)
2277 cp = nch->string;
2285 n->tag = mandoc_strdup(nch->string);
2509 struct roff_node *nch;
2530 (nch = mdoc->last->child) == NULL ? "" :
2531 nch->type == ROFFT_TEXT ? nch->string :
2532 roff_name[nch->tok]);
2553 if ((nch = mdoc->last->child) == NULL ||
2554 nch->type != ROFFT_TEXT || nch->next != NULL)
2559 dist = similar(nch->string, *testsec);
2566 mandoc_msg(MANDOCERR_SEC_TYPO, nch->line, nch->pos,
2567 "Sh %s instead of %s", nch->string, goodsec);
2626 struct roff_node *n, *nch;
2629 nch = n->child;
2630 if (nch->next == NULL) {
2632 n->line, n->pos, "Xr %s", nch->string);
2634 assert(nch->next == n->last);
2635 if(mandoc_xr_add(nch->next->string, nch->string,
2636 nch->line, nch->pos))
2638 nch->line, nch->pos, "Xr %s %s",
2639 nch->string, nch->next->string);
2647 struct roff_node *n, *nch;
2662 if ((nch = n->child) != NULL &&
2663 nch->type == ROFFT_TEXT &&
2664 strcmp(nch->string, tag) == 0)
2678 if ((nch = n->child) != NULL &&
2679 (nch->tok == MDOC_Pp || nch->tok == ROFF_br ||
2680 nch->tok == ROFF_sp)) {
2681 mandoc_msg(MANDOCERR_PAR_SKIP, nch->line, nch->pos,
2682 "%s after %s", roff_name[nch->tok],
2684 roff_node_delete(mdoc, nch);
2686 if ((nch = n->last) != NULL &&
2687 (nch->tok == MDOC_Pp || nch->tok == ROFF_br)) {
2688 mandoc_msg(MANDOCERR_PAR_SKIP, nch->line, nch->pos,
2689 "%s at the end of %s", roff_name[nch->tok],
2691 roff_node_delete(mdoc, nch);
2865 struct roff_node *n, *nch;
2871 nch = n->child;
2873 if (nch != NULL) {
2874 macro = !strcmp(nch->string, "Open") ? "Ox" :
2875 !strcmp(nch->string, "Net") ? "Nx" :
2876 !strcmp(nch->string, "Free") ? "Fx" :
2877 !strcmp(nch->string, "DragonFly") ? "Dx" : NULL;
2881 mdoc->last = nch;
2882 nch = nch->next;
2892 if (nch == NULL) {
2912 *nch->string = (char)toupper((unsigned char)*nch->string);