Lines Matching refs:nch
520 const struct roff_node *nch; in post_delim() local
526 nch = mdoc->last->last; in post_delim()
527 if (nch == NULL || nch->type != ROFFT_TEXT) in post_delim()
529 lc = strchr(nch->string, '\0') - 1; in post_delim()
530 if (lc < nch->string) in post_delim()
539 mandoc_msg(MANDOCERR_DELIM, nch->line, in post_delim()
540 nch->pos + (int)(lc - nch->string), "%s%s %s", roff_name[tok], in post_delim()
541 nch == mdoc->last->child ? "" : " ...", nch->string); in post_delim()
547 const struct roff_node *nch; in post_delim_nb() local
559 nch = mdoc->last->last; in post_delim_nb()
560 if (nch == NULL || nch->type != ROFFT_TEXT) in post_delim_nb()
562 lc = strchr(nch->string, '\0') - 1; in post_delim_nb()
563 if (lc <= nch->string) in post_delim_nb()
574 if (lc > nch->string + 1 && lc[-2] == '\\' && in post_delim_nb()
581 for (cp = lc; cp >= nch->string; cp--) in post_delim_nb()
586 if (lc > nch->string + 1 && lc[-2] == '.' && lc[-1] == '.') in post_delim_nb()
600 for (cp = lc; cp >= nch->string; cp--) in post_delim_nb()
605 if (lc == nch->string + 1 && lc[-1] == '|') in post_delim_nb()
612 if (lc == nch->string + 1 && !isalnum((unsigned char)lc[-1])) in post_delim_nb()
619 for (cp = lc - 1; cp >= nch->string; cp--) { in post_delim_nb()
622 if (cp > nch->string && cp[-1] == ',') in post_delim_nb()
632 mandoc_msg(MANDOCERR_DELIM_NB, nch->line, in post_delim_nb()
633 nch->pos + (int)(lc - nch->string), "%s%s %s", roff_name[tok], in post_delim_nb()
634 nch == mdoc->last->child ? "" : " ...", nch->string); in post_delim_nb()
1082 struct roff_node *n, *nch; in post_st() local
1086 nch = n->child; in post_st()
1087 assert(nch->type == ROFFT_TEXT); in post_st()
1089 if ((p = mdoc_a2st(nch->string)) == NULL) { in post_st()
1091 nch->line, nch->pos, "St %s", nch->string); in post_st()
1096 nch->flags |= NODE_NOPRT; in post_st()
1098 roff_word_alloc(mdoc, nch->line, nch->pos, p); in post_st()
1107 struct roff_node *nch; /* The first child of the .Tg node. */ in post_tg() local
1124 nt = nch = n->child; in post_tg()
1125 if (nch == NULL && nn != NULL && nn->child != NULL && in post_tg()
1142 if (nch != NULL && nch->next != NULL) { in post_tg()
1143 mandoc_msg(MANDOCERR_ARG_EXCESS, nch->next->line, in post_tg()
1144 nch->next->pos, "Tg ... %s", nch->next->string); in post_tg()
1145 while (nch->next != NULL) in post_tg()
1146 roff_node_delete(mdoc, nch->next); in post_tg()
1251 struct roff_node *np, *nch; in post_bf() local
1267 nch = np->child; in post_bf()
1269 if (nch == NULL) { in post_bf()
1274 nch = nch->next; in post_bf()
1276 if (nch != NULL) in post_bf()
1278 nch->line, nch->pos, "Bf ... %s", nch->string); in post_bf()
1315 struct roff_node *n, *nch; in post_fname() local
1320 nch = n->child; in post_fname()
1321 cp = nch->string; in post_fname()
1335 mandoc_msg(MANDOCERR_FN_PAREN, nch->line, nch->pos + pos, "%s", cp); in post_fname()
1532 struct roff_node *n, *nch; in post_at() local
1536 nch = n->child; in post_at()
1545 if (nch != NULL && ((att = mdoc_a2att(nch->string)) == NULL)) in post_at()
1547 nch->line, nch->pos, "At %s", nch->string); in post_at()
1551 roff_word_alloc(mdoc, nch->line, nch->pos, att); in post_at()
1552 nch->flags |= NODE_NOPRT; in post_at()
1562 struct roff_node *np, *nch; in post_an() local
1567 nch = np->child; in post_an()
1569 if (nch == NULL) in post_an()
1574 } else if (nch != NULL) in post_an()
1576 nch->line, nch->pos, "An ... %s", nch->string); in post_an()
1710 struct roff_node *nbl, *nit, *nch; in post_it() local
1744 if ((nch = nit->head->child) != NULL) in post_it()
1747 nch->type == ROFFT_TEXT ? nch->string : in post_it()
1748 roff_name[nch->tok]); in post_it()
1764 for (nch = nit->child; nch != NULL; nch = nch->next) { in post_it()
1765 if (nch->type != ROFFT_BODY) in post_it()
1767 if (i++ && nch->flags & NODE_LINE) in post_it()
1769 nch->line, nch->pos, "Ta"); in post_it()
1892 struct roff_node *nbl, *nh, *nch, *nnext; in post_bl_head() local
1900 if ((nch = nh->child) == NULL) in post_bl_head()
1903 nch->line, nch->pos, "Bl ... %s", nch->string); in post_bl_head()
1904 while (nch != NULL) { in post_bl_head()
1905 roff_node_delete(mdoc, nch); in post_bl_head()
1906 nch = nh->child; in post_bl_head()
1935 for (nch = nh->child; nch != NULL; nch = nch->next) in post_bl_head()
1943 for (nch = nh->child; nch != NULL; nch = nnext) { in post_bl_head()
1944 argv->value[i++] = nch->string; in post_bl_head()
1945 nch->string = NULL; in post_bl_head()
1946 nnext = nch->next; in post_bl_head()
1947 roff_node_delete(NULL, nch); in post_bl_head()
2091 struct roff_node *nch; in post_sm() local
2093 nch = mdoc->last->child; in post_sm()
2095 if (nch == NULL) { in post_sm()
2100 assert(nch->type == ROFFT_TEXT); in post_sm()
2102 if ( ! strcmp(nch->string, "on")) { in post_sm()
2106 if ( ! strcmp(nch->string, "off")) { in post_sm()
2111 mandoc_msg(MANDOCERR_SM_BAD, nch->line, nch->pos, in post_sm()
2112 "%s %s", roff_name[mdoc->last->tok], nch->string); in post_sm()
2113 roff_node_relink(mdoc, nch); in post_sm()
2178 struct roff_node *np, *nch, *next, *prev; in post_rs() local
2198 for (nch = np->child->next; nch != NULL; nch = next) { in post_rs()
2201 if (rsord[i] == nch->tok) in post_rs()
2205 mandoc_msg(MANDOCERR_RS_BAD, nch->line, nch->pos, in post_rs()
2206 "%s", roff_name[nch->tok]); in post_rs()
2208 } else if (nch->tok == MDOC__J || nch->tok == MDOC__B) in post_rs()
2218 if ((next = nch->next) != NULL) in post_rs()
2219 next->prev = nch->prev; in post_rs()
2221 if ((prev = nch->prev) != NULL) in post_rs()
2222 prev->next = nch->next; in post_rs()
2224 nch->prev = nch->next = NULL; in post_rs()
2248 nch->prev = prev; in post_rs()
2251 np->child->prev = nch; in post_rs()
2252 nch->next = np->child; in post_rs()
2253 np->child = nch; in post_rs()
2256 prev->next->prev = nch; in post_rs()
2257 nch->next = prev->next; in post_rs()
2258 prev->next = nch; in post_rs()
2270 struct roff_node *n, *nch; in post_hyph() local
2274 for (nch = n->child; nch != NULL; nch = nch->next) { in post_hyph()
2275 if (nch->type != ROFFT_TEXT) in post_hyph()
2277 cp = nch->string; in post_hyph()
2285 n->tag = mandoc_strdup(nch->string); in post_hyph()
2509 struct roff_node *nch; in post_sh_head() local
2530 (nch = mdoc->last->child) == NULL ? "" : in post_sh_head()
2531 nch->type == ROFFT_TEXT ? nch->string : in post_sh_head()
2532 roff_name[nch->tok]); in post_sh_head()
2553 if ((nch = mdoc->last->child) == NULL || in post_sh_head()
2554 nch->type != ROFFT_TEXT || nch->next != NULL) in post_sh_head()
2559 dist = similar(nch->string, *testsec); in post_sh_head()
2566 mandoc_msg(MANDOCERR_SEC_TYPO, nch->line, nch->pos, in post_sh_head()
2567 "Sh %s instead of %s", nch->string, goodsec); in post_sh_head()
2626 struct roff_node *n, *nch; in post_xr() local
2629 nch = n->child; in post_xr()
2630 if (nch->next == NULL) { in post_xr()
2632 n->line, n->pos, "Xr %s", nch->string); in post_xr()
2634 assert(nch->next == n->last); in post_xr()
2635 if(mandoc_xr_add(nch->next->string, nch->string, in post_xr()
2636 nch->line, nch->pos)) in post_xr()
2638 nch->line, nch->pos, "Xr %s %s", in post_xr()
2639 nch->string, nch->next->string); in post_xr()
2647 struct roff_node *n, *nch; in post_section() local
2662 if ((nch = n->child) != NULL && in post_section()
2663 nch->type == ROFFT_TEXT && in post_section()
2664 strcmp(nch->string, tag) == 0) in post_section()
2678 if ((nch = n->child) != NULL && in post_section()
2679 (nch->tok == MDOC_Pp || nch->tok == ROFF_br || in post_section()
2680 nch->tok == ROFF_sp)) { in post_section()
2681 mandoc_msg(MANDOCERR_PAR_SKIP, nch->line, nch->pos, in post_section()
2682 "%s after %s", roff_name[nch->tok], in post_section()
2684 roff_node_delete(mdoc, nch); in post_section()
2686 if ((nch = n->last) != NULL && in post_section()
2687 (nch->tok == MDOC_Pp || nch->tok == ROFF_br)) { in post_section()
2688 mandoc_msg(MANDOCERR_PAR_SKIP, nch->line, nch->pos, in post_section()
2689 "%s at the end of %s", roff_name[nch->tok], in post_section()
2691 roff_node_delete(mdoc, nch); in post_section()
2865 struct roff_node *n, *nch; in post_bx() local
2871 nch = n->child; in post_bx()
2873 if (nch != NULL) { in post_bx()
2874 macro = !strcmp(nch->string, "Open") ? "Ox" : in post_bx()
2875 !strcmp(nch->string, "Net") ? "Nx" : in post_bx()
2876 !strcmp(nch->string, "Free") ? "Fx" : in post_bx()
2877 !strcmp(nch->string, "DragonFly") ? "Dx" : NULL; in post_bx()
2881 mdoc->last = nch; in post_bx()
2882 nch = nch->next; in post_bx()
2892 if (nch == NULL) { in post_bx()
2912 *nch->string = (char)toupper((unsigned char)*nch->string); in post_bx()