Lines Matching defs:nch

518 	const struct roff_node	*nch;
524 nch = mdoc->last->last;
525 if (nch == NULL || nch->type != ROFFT_TEXT)
527 lc = strchr(nch->string, '\0') - 1;
528 if (lc < nch->string)
537 mandoc_msg(MANDOCERR_DELIM, nch->line,
538 nch->pos + (int)(lc - nch->string), "%s%s %s", roff_name[tok],
539 nch == mdoc->last->child ? "" : " ...", nch->string);
545 const struct roff_node *nch;
557 nch = mdoc->last->last;
558 if (nch == NULL || nch->type != ROFFT_TEXT)
560 lc = strchr(nch->string, '\0') - 1;
561 if (lc <= nch->string)
572 if (lc > nch->string + 1 && lc[-2] == '\\' &&
579 for (cp = lc; cp >= nch->string; cp--)
584 if (lc > nch->string + 1 && lc[-2] == '.' && lc[-1] == '.')
598 for (cp = lc; cp >= nch->string; cp--)
603 if (lc == nch->string + 1 && lc[-1] == '|')
610 if (lc == nch->string + 1 && !isalnum((unsigned char)lc[-1]))
617 for (cp = lc - 1; cp >= nch->string; cp--) {
620 if (cp > nch->string && cp[-1] == ',')
630 mandoc_msg(MANDOCERR_DELIM_NB, nch->line,
631 nch->pos + (int)(lc - nch->string), "%s%s %s", roff_name[tok],
632 nch == mdoc->last->child ? "" : " ...", nch->string);
1067 struct roff_node *n, *nch;
1071 nch = n->child;
1072 assert(nch->type == ROFFT_TEXT);
1074 if ((p = mdoc_a2st(nch->string)) == NULL) {
1076 nch->line, nch->pos, "St %s", nch->string);
1081 nch->flags |= NODE_NOPRT;
1083 roff_word_alloc(mdoc, nch->line, nch->pos, p);
1092 struct roff_node *nch; /* The first child of the .Tg node. */
1109 nt = nch = n->child;
1110 if (nch == NULL && nn != NULL && nn->child != NULL &&
1127 if (nch != NULL && nch->next != NULL) {
1128 mandoc_msg(MANDOCERR_ARG_EXCESS, nch->next->line,
1129 nch->next->pos, "Tg ... %s", nch->next->string);
1130 while (nch->next != NULL)
1131 roff_node_delete(mdoc, nch->next);
1236 struct roff_node *np, *nch;
1252 nch = np->child;
1254 if (nch == NULL) {
1259 nch = nch->next;
1261 if (nch != NULL)
1263 nch->line, nch->pos, "Bf ... %s", nch->string);
1300 struct roff_node *n, *nch;
1305 nch = n->child;
1306 cp = nch->string;
1320 mandoc_msg(MANDOCERR_FN_PAREN, nch->line, nch->pos + pos, "%s", cp);
1517 struct roff_node *n, *nch;
1521 nch = n->child;
1530 if (nch != NULL && ((att = mdoc_a2att(nch->string)) == NULL))
1532 nch->line, nch->pos, "At %s", nch->string);
1536 roff_word_alloc(mdoc, nch->line, nch->pos, att);
1537 nch->flags |= NODE_NOPRT;
1547 struct roff_node *np, *nch;
1552 nch = np->child;
1554 if (nch == NULL)
1559 } else if (nch != NULL)
1561 nch->line, nch->pos, "An ... %s", nch->string);
1695 struct roff_node *nbl, *nit, *nch;
1729 if ((nch = nit->head->child) != NULL)
1732 nch->type == ROFFT_TEXT ? nch->string :
1733 roff_name[nch->tok]);
1749 for (nch = nit->child; nch != NULL; nch = nch->next) {
1750 if (nch->type != ROFFT_BODY)
1752 if (i++ && nch->flags & NODE_LINE)
1754 nch->line, nch->pos, "Ta");
1833 struct roff_node *nbl, *nh, *nch, *nnext;
1841 if ((nch = nh->child) == NULL)
1844 nch->line, nch->pos, "Bl ... %s", nch->string);
1845 while (nch != NULL) {
1846 roff_node_delete(mdoc, nch);
1847 nch = nh->child;
1876 for (nch = nh->child; nch != NULL; nch = nch->next)
1884 for (nch = nh->child; nch != NULL; nch = nnext) {
1885 argv->value[i++] = nch->string;
1886 nch->string = NULL;
1887 nnext = nch->next;
1888 roff_node_delete(NULL, nch);
2032 struct roff_node *nch;
2034 nch = mdoc->last->child;
2036 if (nch == NULL) {
2041 assert(nch->type == ROFFT_TEXT);
2043 if ( ! strcmp(nch->string, "on")) {
2047 if ( ! strcmp(nch->string, "off")) {
2052 mandoc_msg(MANDOCERR_SM_BAD, nch->line, nch->pos,
2053 "%s %s", roff_name[mdoc->last->tok], nch->string);
2054 roff_node_relink(mdoc, nch);
2119 struct roff_node *np, *nch, *next, *prev;
2139 for (nch = np->child->next; nch != NULL; nch = next) {
2142 if (rsord[i] == nch->tok)
2146 mandoc_msg(MANDOCERR_RS_BAD, nch->line, nch->pos,
2147 "%s", roff_name[nch->tok]);
2149 } else if (nch->tok == MDOC__J || nch->tok == MDOC__B)
2159 if ((next = nch->next) != NULL)
2160 next->prev = nch->prev;
2162 if ((prev = nch->prev) != NULL)
2163 prev->next = nch->next;
2165 nch->prev = nch->next = NULL;
2189 nch->prev = prev;
2192 np->child->prev = nch;
2193 nch->next = np->child;
2194 np->child = nch;
2197 prev->next->prev = nch;
2198 nch->next = prev->next;
2199 prev->next = nch;
2211 struct roff_node *n, *nch;
2215 for (nch = n->child; nch != NULL; nch = nch->next) {
2216 if (nch->type != ROFFT_TEXT)
2218 cp = nch->string;
2226 n->tag = mandoc_strdup(nch->string);
2450 struct roff_node *nch;
2471 (nch = mdoc->last->child) == NULL ? "" :
2472 nch->type == ROFFT_TEXT ? nch->string :
2473 roff_name[nch->tok]);
2494 if ((nch = mdoc->last->child) == NULL ||
2495 nch->type != ROFFT_TEXT || nch->next != NULL)
2500 dist = similar(nch->string, *testsec);
2507 mandoc_msg(MANDOCERR_SEC_TYPO, nch->line, nch->pos,
2508 "Sh %s instead of %s", nch->string, goodsec);
2567 struct roff_node *n, *nch;
2570 nch = n->child;
2571 if (nch->next == NULL) {
2573 n->line, n->pos, "Xr %s", nch->string);
2575 assert(nch->next == n->last);
2576 if(mandoc_xr_add(nch->next->string, nch->string,
2577 nch->line, nch->pos))
2579 nch->line, nch->pos, "Xr %s %s",
2580 nch->string, nch->next->string);
2588 struct roff_node *n, *nch;
2603 if ((nch = n->child) != NULL &&
2604 nch->type == ROFFT_TEXT &&
2605 strcmp(nch->string, tag) == 0)
2619 if ((nch = n->child) != NULL &&
2620 (nch->tok == MDOC_Pp || nch->tok == ROFF_br ||
2621 nch->tok == ROFF_sp)) {
2622 mandoc_msg(MANDOCERR_PAR_SKIP, nch->line, nch->pos,
2623 "%s after %s", roff_name[nch->tok],
2625 roff_node_delete(mdoc, nch);
2627 if ((nch = n->last) != NULL &&
2628 (nch->tok == MDOC_Pp || nch->tok == ROFF_br)) {
2629 mandoc_msg(MANDOCERR_PAR_SKIP, nch->line, nch->pos,
2630 "%s at the end of %s", roff_name[nch->tok],
2632 roff_node_delete(mdoc, nch);
2806 struct roff_node *n, *nch;
2812 nch = n->child;
2814 if (nch != NULL) {
2815 macro = !strcmp(nch->string, "Open") ? "Ox" :
2816 !strcmp(nch->string, "Net") ? "Nx" :
2817 !strcmp(nch->string, "Free") ? "Fx" :
2818 !strcmp(nch->string, "DragonFly") ? "Dx" : NULL;
2822 mdoc->last = nch;
2823 nch = nch->next;
2833 if (nch == NULL) {
2853 *nch->string = (char)toupper((unsigned char)*nch->string);