Lines Matching refs:n
304 struct roff_node *n, *np; in mdoc_validate() local
313 n = mdoc->last; in mdoc_validate()
314 switch (n->tok) { in mdoc_validate()
316 n->tok = MDOC_Pp; in mdoc_validate()
320 n->tok = MDOC_Ft; in mdoc_validate()
334 if (mdoc->last == n) in mdoc_validate()
342 mdoc->last = n; in mdoc_validate()
344 switch (n->type) { in mdoc_validate()
346 np = n->parent; in mdoc_validate()
347 if (n->sec != SEC_SYNOPSIS || in mdoc_validate()
349 check_text(mdoc, n->line, n->pos, n->string); in mdoc_validate()
350 if ((n->flags & NODE_NOFILL) == 0 && in mdoc_validate()
353 check_text_em(mdoc, n->line, n->pos, n->string); in mdoc_validate()
356 check_toptext(mdoc, n->line, n->pos, n->string); in mdoc_validate()
374 if (n->child != NULL) in mdoc_validate()
375 n->child->flags &= ~NODE_DELIMC; in mdoc_validate()
376 if (n->last != NULL) in mdoc_validate()
377 n->last->flags &= ~NODE_DELIMO; in mdoc_validate()
381 if (n->tok < ROFF_MAX) { in mdoc_validate()
386 assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); in mdoc_validate()
387 p = mdoc_valids + (n->tok - MDOC_Dd); in mdoc_validate()
390 if (mdoc->last == n) in mdoc_validate()
391 mdoc_state(mdoc, n); in mdoc_validate()
397 check_args(struct roff_man *mdoc, struct roff_node *n) in check_args() argument
401 if (NULL == n->args) in check_args()
404 assert(n->args->argc); in check_args()
405 for (i = 0; i < (int)n->args->argc; i++) in check_args()
406 check_argv(mdoc, n, &n->args->argv[i]); in check_args()
410 check_argv(struct roff_man *mdoc, struct roff_node *n, struct mdoc_argv *v) in check_argv() argument
640 struct roff_node *n; in post_bl_norm() local
646 n = mdoc->last->parent; in post_bl_norm()
647 n->norm->Bl.type = LIST__NONE; in post_bl_norm()
655 wa = (n->args == NULL) ? NULL : n->args->argv; in post_bl_norm()
657 for (i = 0; n->args && i < (int)n->args->argc; i++) { in post_bl_norm()
658 argv = n->args->argv + i; in post_bl_norm()
697 if (n->norm->Bl.comp) in post_bl_norm()
700 n->norm->Bl.comp = 1; in post_bl_norm()
707 n->norm->Bl.width = "0n"; in post_bl_norm()
710 if (NULL != n->norm->Bl.width) in post_bl_norm()
715 n->norm->Bl.width = argv->value[0]; in post_bl_norm()
723 if (NULL != n->norm->Bl.offs) in post_bl_norm()
728 n->norm->Bl.offs = argv->value[0]; in post_bl_norm()
739 if (LIST__NONE != n->norm->Bl.type) { in post_bl_norm()
740 mandoc_msg(MANDOCERR_BL_REP, n->line, n->pos, in post_bl_norm()
747 if (n->norm->Bl.width || in post_bl_norm()
748 n->norm->Bl.offs || in post_bl_norm()
749 n->norm->Bl.comp) in post_bl_norm()
751 n->line, n->pos, "Bl -%s", in post_bl_norm()
752 mdoc_argnames[n->args->argv[0].arg]); in post_bl_norm()
754 n->norm->Bl.type = lt; in post_bl_norm()
756 n->norm->Bl.ncols = argv->sz; in post_bl_norm()
757 n->norm->Bl.cols = (void *)argv->value; in post_bl_norm()
763 if (LIST__NONE == n->norm->Bl.type) { in post_bl_norm()
764 mandoc_msg(MANDOCERR_BL_NOTYPE, n->line, n->pos, "Bl"); in post_bl_norm()
765 n->norm->Bl.type = LIST_item; in post_bl_norm()
776 switch (n->norm->Bl.type) { in post_bl_norm()
778 if (n->norm->Bl.width == NULL) in post_bl_norm()
780 n->line, n->pos, "Bl -tag"); in post_bl_norm()
787 if (n->norm->Bl.width != NULL) in post_bl_norm()
790 n->norm->Bl.width = NULL; in post_bl_norm()
795 if (n->norm->Bl.width == NULL) in post_bl_norm()
796 n->norm->Bl.width = "2n"; in post_bl_norm()
799 if (n->norm->Bl.width == NULL) in post_bl_norm()
800 n->norm->Bl.width = "3n"; in post_bl_norm()
810 struct roff_node *n; in post_bd() local
815 n = mdoc->last; in post_bd()
816 for (i = 0; n->args && i < (int)n->args->argc; i++) { in post_bd()
817 argv = n->args->argv + i; in post_bd()
837 mandoc_msg(MANDOCERR_BD_FILE, n->line, n->pos, NULL); in post_bd()
845 if (NULL != n->norm->Bd.offs) in post_bd()
850 n->norm->Bd.offs = argv->value[0]; in post_bd()
853 if (n->norm->Bd.comp) in post_bd()
856 n->norm->Bd.comp = 1; in post_bd()
864 if (DISP__NONE == n->norm->Bd.type) in post_bd()
865 n->norm->Bd.type = dt; in post_bd()
867 mandoc_msg(MANDOCERR_BD_REP, n->line, n->pos, in post_bd()
871 if (DISP__NONE == n->norm->Bd.type) { in post_bd()
872 mandoc_msg(MANDOCERR_BD_NOTYPE, n->line, n->pos, "Bd"); in post_bd()
873 n->norm->Bd.type = DISP_ragged; in post_bd()
884 struct roff_node *n; in post_an_norm() local
888 n = mdoc->last; in post_an_norm()
889 if (n->args == NULL) in post_an_norm()
892 for (i = 1; i < n->args->argc; i++) { in post_an_norm()
893 argv = n->args->argv + i; in post_an_norm()
898 argv = n->args->argv; in post_an_norm()
900 n->norm->An.auth = AUTH_split; in post_an_norm()
902 n->norm->An.auth = AUTH_nosplit; in post_an_norm()
910 struct roff_node *n; in post_eoln() local
913 n = mdoc->last; in post_eoln()
914 if (n->child != NULL) in post_eoln()
915 mandoc_msg(MANDOCERR_ARG_SKIP, n->line, in post_eoln()
916 n->pos, "%s %s", roff_name[n->tok], n->child->string); in post_eoln()
918 while (n->child != NULL) in post_eoln()
919 roff_node_delete(mdoc, n->child); in post_eoln()
921 roff_word_alloc(mdoc, n->line, n->pos, n->tok == MDOC_Bt ? in post_eoln()
924 mdoc->last = n; in post_eoln()
930 struct roff_node *n; in build_list() local
933 n = mdoc->last->next; in build_list()
935 roff_elem_alloc(mdoc, n->line, n->pos, tok); in build_list()
937 roff_node_relink(mdoc, n); in build_list()
938 n = mdoc->last = mdoc->last->parent; in build_list()
940 if (n->next == NULL) in build_list()
942 if (ic > 1 || n->next->next != NULL) { in build_list()
943 roff_word_alloc(mdoc, n->line, n->pos, ","); in build_list()
946 n = mdoc->last->next; in build_list()
947 if (n->next == NULL) { in build_list()
948 roff_word_alloc(mdoc, n->line, n->pos, "and"); in build_list()
957 struct roff_node *n; in post_ex() local
962 n = mdoc->last; in post_ex()
964 roff_word_alloc(mdoc, n->line, n->pos, "The"); in post_ex()
970 roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Nm); in post_ex()
972 roff_word_alloc(mdoc, n->line, n->pos, mdoc->meta.name); in post_ex()
978 mandoc_msg(MANDOCERR_EX_NONAME, n->line, n->pos, "Ex"); in post_ex()
982 roff_word_alloc(mdoc, n->line, n->pos, in post_ex()
985 roff_word_alloc(mdoc, n->line, n->pos, in post_ex()
988 mdoc->last = n; in post_ex()
994 struct roff_node *n; in post_lb() local
999 n = mdoc->last; in post_lb()
1000 assert(n->child->type == ROFFT_TEXT); in post_lb()
1003 if ((p = mdoc_a2lib(n->child->string)) != NULL) { in post_lb()
1004 n->child->flags |= NODE_NOPRT; in post_lb()
1005 roff_word_alloc(mdoc, n->line, n->pos, p); in post_lb()
1007 mdoc->last = n; in post_lb()
1011 mandoc_msg(MANDOCERR_LB_BAD, n->child->line, in post_lb()
1012 n->child->pos, "Lb %s", n->child->string); in post_lb()
1014 roff_word_alloc(mdoc, n->line, n->pos, "library"); in post_lb()
1016 roff_word_alloc(mdoc, n->line, n->pos, "\\(lq"); in post_lb()
1019 roff_word_alloc(mdoc, n->line, n->pos, "\\(rq"); in post_lb()
1021 mdoc->last = n; in post_lb()
1027 struct roff_node *n; in post_rv() local
1032 n = mdoc->last; in post_rv()
1034 if (n->child != NULL) { in post_rv()
1035 roff_word_alloc(mdoc, n->line, n->pos, "The"); in post_rv()
1038 roff_word_alloc(mdoc, n->line, n->pos, in post_rv()
1041 roff_word_alloc(mdoc, n->line, n->pos, in post_rv()
1044 roff_word_alloc(mdoc, n->line, n->pos, "Upon successful " in post_rv()
1048 roff_word_alloc(mdoc, n->line, n->pos, "otherwise " in post_rv()
1051 roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Va); in post_rv()
1053 roff_word_alloc(mdoc, n->line, n->pos, "errno"); in post_rv()
1057 roff_word_alloc(mdoc, n->line, n->pos, in post_rv()
1060 mdoc->last = n; in post_rv()
1066 struct roff_node *n; in post_std() local
1070 n = mdoc->last; in post_std()
1071 if (n->args && n->args->argc == 1) in post_std()
1072 if (n->args->argv[0].arg == MDOC_Std) in post_std()
1075 mandoc_msg(MANDOCERR_ARG_STD, n->line, n->pos, in post_std()
1076 "%s", roff_name[n->tok]); in post_std()
1082 struct roff_node *n, *nch; in post_st() local
1085 n = mdoc->last; in post_st()
1086 nch = n->child; in post_st()
1092 roff_node_delete(mdoc, n); in post_st()
1100 mdoc->last= n; in post_st()
1106 struct roff_node *n; /* The .Tg node. */ in post_tg() local
1114 n = mdoc->last; in post_tg()
1115 for (nn = n; nn != NULL; nn = nn->parent) { in post_tg()
1124 nt = nch = n->child; in post_tg()
1131 mandoc_msg(MANDOCERR_MACRO_EMPTY, n->line, n->pos, "Tg"); in post_tg()
1133 roff_node_delete(mdoc, n); in post_tg()
1151 roff_node_delete(mdoc, n); in post_tg()
1157 nn = n; in post_tg()
1164 nn = nn->head->child == NULL ? n : nn->head; in post_tg()
1185 nn = nn->body->child == NULL ? n : nn->body; in post_tg()
1195 nn = nn->body->child == NULL ? n : nn->body; in post_tg()
1212 nn = n; in post_tg()
1215 nn = n; in post_tg()
1219 if (nn != n) in post_tg()
1220 n->flags |= NODE_NOPRT; in post_tg()
1226 struct roff_node *n; in post_obsolete() local
1228 n = mdoc->last; in post_obsolete()
1229 if (n->type == ROFFT_ELEM || n->type == ROFFT_BLOCK) in post_obsolete()
1230 mandoc_msg(MANDOCERR_MACRO_OBS, n->line, n->pos, in post_obsolete()
1231 "%s", roff_name[n->tok]); in post_obsolete()
1237 struct roff_node *n; in post_useless() local
1239 n = mdoc->last; in post_useless()
1240 mandoc_msg(MANDOCERR_MACRO_USELESS, n->line, n->pos, in post_useless()
1241 "%s", roff_name[n->tok]); in post_useless()
1315 struct roff_node *n, *nch; in post_fname() local
1319 n = mdoc->last; in post_fname()
1320 nch = n->child; in post_fname()
1329 if (n->sec == SEC_DESCRIPTION || in post_fname()
1330 n->sec == SEC_CUSTOM) in post_fname()
1331 tag_put(NULL, fn_prio++, n); in post_fname()
1348 const struct roff_node *n; in post_fo() local
1350 n = mdoc->last; in post_fo()
1352 if (n->type != ROFFT_HEAD) in post_fo()
1355 if (n->child == NULL) { in post_fo()
1356 mandoc_msg(MANDOCERR_FO_NOHEAD, n->line, n->pos, "Fo"); in post_fo()
1359 if (n->child != n->last) { in post_fo()
1361 n->child->next->line, n->child->next->pos, in post_fo()
1362 "Fo ... %s", n->child->next->string); in post_fo()
1363 while (n->child != n->last) in post_fo()
1364 roff_node_delete(mdoc, n->last); in post_fo()
1374 const struct roff_node *n; in post_fa() local
1377 for (n = mdoc->last->child; n != NULL; n = n->next) { in post_fa()
1378 for (cp = n->string; *cp != '\0'; cp++) { in post_fa()
1384 mandoc_msg(MANDOCERR_FA_COMMA, n->line, in post_fa()
1385 n->pos + (int)(cp - n->string), "%s", n->string); in post_fa()
1395 struct roff_node *n; in post_nm() local
1397 n = mdoc->last; in post_nm()
1399 if (n->sec == SEC_NAME && n->child != NULL && in post_nm()
1400 n->child->type == ROFFT_TEXT && mdoc->meta.msec != NULL) in post_nm()
1401 mandoc_xr_add(mdoc->meta.msec, n->child->string, -1, -1); in post_nm()
1403 if (n->last != NULL && n->last->tok == MDOC_Pp) in post_nm()
1404 roff_node_relink(mdoc, n->last); in post_nm()
1407 deroff(&mdoc->meta.name, n); in post_nm()
1410 (mdoc->lastsec == SEC_NAME && n->child == NULL)) in post_nm()
1411 mandoc_msg(MANDOCERR_NM_NONAME, n->line, n->pos, "Nm"); in post_nm()
1413 switch (n->type) { in post_nm()
1424 if ((n->child != NULL && n->child->type == ROFFT_TEXT) || in post_nm()
1429 roff_word_alloc(mdoc, n->line, n->pos, mdoc->meta.name); in post_nm()
1431 mdoc->last = n; in post_nm()
1437 struct roff_node *n; in post_nd() local
1439 n = mdoc->last; in post_nd()
1441 if (n->type != ROFFT_BODY) in post_nd()
1444 if (n->sec != SEC_NAME) in post_nd()
1445 mandoc_msg(MANDOCERR_ND_LATE, n->line, n->pos, "Nd"); in post_nd()
1447 if (n->child == NULL) in post_nd()
1448 mandoc_msg(MANDOCERR_ND_EMPTY, n->line, n->pos, "Nd"); in post_nd()
1458 struct roff_node *n, *np; in post_display() local
1460 n = mdoc->last; in post_display()
1461 switch (n->type) { in post_display()
1463 if (n->end != ENDBODY_NOT) { in post_display()
1464 if (n->tok == MDOC_Bd && in post_display()
1465 n->body->parent->args == NULL) in post_display()
1466 roff_node_delete(mdoc, n); in post_display()
1467 } else if (n->child == NULL) in post_display()
1468 mandoc_msg(MANDOCERR_BLK_EMPTY, n->line, n->pos, in post_display()
1469 "%s", roff_name[n->tok]); in post_display()
1470 else if (n->tok == MDOC_D1) in post_display()
1474 if (n->tok == MDOC_Bd) { in post_display()
1475 if (n->args == NULL) { in post_display()
1477 n->line, n->pos, "Bd"); in post_display()
1479 while (n->body->child != NULL) in post_display()
1481 n->body->child); in post_display()
1482 roff_node_delete(mdoc, n); in post_display()
1488 for (np = n->parent; np != NULL; np = np->parent) { in post_display()
1490 mandoc_msg(MANDOCERR_BD_NEST, n->line, in post_display()
1491 n->pos, "%s in Bd", roff_name[n->tok]); in post_display()
1504 struct roff_node *n; in post_defaults() local
1506 n = mdoc->last; in post_defaults()
1507 if (n->child != NULL) { in post_defaults()
1512 switch (n->tok) { in post_defaults()
1514 roff_word_alloc(mdoc, n->line, n->pos, "file"); in post_defaults()
1516 roff_word_alloc(mdoc, n->line, n->pos, "..."); in post_defaults()
1520 roff_word_alloc(mdoc, n->line, n->pos, "~"); in post_defaults()
1526 mdoc->last = n; in post_defaults()
1532 struct roff_node *n, *nch; in post_at() local
1535 n = mdoc->last; in post_at()
1536 nch = n->child; in post_at()
1554 roff_word_alloc(mdoc, n->line, n->pos, "AT&T UNIX"); in post_at()
1556 mdoc->last = n; in post_at()
1597 struct roff_node *n; in post_er() local
1599 n = mdoc->last; in post_er()
1600 if (n->sec == SEC_ERRORS && in post_er()
1601 (n->parent->tok == MDOC_It || in post_er()
1602 (n->parent->tok == MDOC_Bq && in post_er()
1603 n->parent->parent->parent->tok == MDOC_It))) in post_er()
1604 tag_put(NULL, TAG_STRONG, n); in post_er()
1611 struct roff_node *n; in post_tag() local
1613 n = mdoc->last; in post_tag()
1614 if ((n->prev == NULL || in post_tag()
1615 (n->prev->type == ROFFT_TEXT && in post_tag()
1616 strcmp(n->prev->string, "|") == 0)) && in post_tag()
1617 (n->parent->tok == MDOC_It || in post_tag()
1618 (n->parent->tok == MDOC_Xo && in post_tag()
1619 n->parent->parent->prev == NULL && in post_tag()
1620 n->parent->parent->parent->tok == MDOC_It))) in post_tag()
1621 tag_put(NULL, TAG_STRONG, n); in post_tag()
1635 struct roff_node *n; in post_fl() local
1643 n = mdoc->last; in post_fl()
1644 if (n->prev != NULL && n->prev->tok == MDOC_Fl && in post_fl()
1645 n->prev->child == NULL && n->child != NULL && in post_fl()
1646 (n->flags & NODE_LINE) == 0) { in post_fl()
1647 mandoc_asprintf(&cp, "\\-%s", n->child->string); in post_fl()
1648 free(n->child->string); in post_fl()
1649 n->child->string = cp; in post_fl()
1650 roff_node_delete(mdoc, n->prev); in post_fl()
1658 struct roff_node *n; in post_xx() local
1664 n = mdoc->last; in post_xx()
1665 switch (n->tok) { in post_xx()
1677 if (n->child == NULL) in post_xx()
1679 v = n->child->string; in post_xx()
1684 n->child->flags |= NODE_NOPRT; in post_xx()
1686 roff_word_alloc(mdoc, n->child->line, n->child->pos, v); in post_xx()
1690 mdoc->last = n; in post_xx()
1702 roff_word_alloc(mdoc, n->line, n->pos, os); in post_xx()
1704 mdoc->last = n; in post_xx()
1787 struct roff_node *n, *ni, *nc; in post_bl_block() local
1791 n = mdoc->last; in post_bl_block()
1792 for (ni = n->body->child; ni != NULL; ni = ni->next) { in post_bl_block()
1809 } else if (n->norm->Bl.comp == 0 && in post_bl_block()
1810 n->norm->Bl.type != LIST_column) { in post_bl_block()
2078 struct roff_node *n; in post_bk() local
2080 n = mdoc->last; in post_bk()
2082 if (n->type == ROFFT_BLOCK && n->body->child == NULL) { in post_bk()
2083 mandoc_msg(MANDOCERR_BLK_EMPTY, n->line, n->pos, "Bk"); in post_bk()
2084 roff_node_delete(mdoc, n); in post_bk()
2120 struct roff_node *n; in post_root() local
2146 n = mdoc->meta.first->child; in post_root()
2147 while (n->tok != MDOC_Dt || in post_root()
2148 n->child == NULL || in post_root()
2149 n->child->next == NULL || in post_root()
2150 n->child->next->next == NULL) in post_root()
2151 n = n->next; in post_root()
2152 n = n->child->next->next; in post_root()
2153 mandoc_msg(MANDOCERR_ARCH_BAD, n->line, n->pos, in post_root()
2161 n = mdoc->meta.first->child; in post_root()
2162 while (n != NULL && in post_root()
2163 (n->type == ROFFT_COMMENT || in post_root()
2164 (n->tok >= MDOC_Dd && in post_root()
2165 mdoc_macro(n->tok)->flags & MDOC_PROLOGUE))) in post_root()
2166 n = n->next; in post_root()
2168 if (n == NULL) in post_root()
2170 else if (n->tok != MDOC_Sh) in post_root()
2171 mandoc_msg(MANDOCERR_SEC_BEFORE, n->line, n->pos, in post_root()
2172 "%s", roff_name[n->tok]); in post_root()
2270 struct roff_node *n, *nch; in post_hyph() local
2273 n = mdoc->last; in post_hyph()
2274 for (nch = n->child; nch != NULL; nch = nch->next) { in post_hyph()
2284 if (n->tag == NULL && n->flags & NODE_ID) in post_hyph()
2285 n->tag = mandoc_strdup(nch->string); in post_hyph()
2294 struct roff_node *n; in post_ns() local
2296 n = mdoc->last; in post_ns()
2297 if (n->flags & NODE_LINE || in post_ns()
2298 (n->next != NULL && n->next->flags & NODE_DELIMC)) in post_ns()
2299 mandoc_msg(MANDOCERR_NS_SKIP, n->line, n->pos, NULL); in post_ns()
2341 struct roff_node *n; in post_sh_name() local
2346 for (n = mdoc->last->child; n != NULL; n = n->next) { in post_sh_name()
2347 switch (n->tok) { in post_sh_name()
2349 if (hasnm && n->child != NULL) in post_sh_name()
2351 n->line, n->pos, in post_sh_name()
2352 "Nm %s", n->child->string); in post_sh_name()
2357 if (n->next != NULL) in post_sh_name()
2359 n->line, n->pos, NULL); in post_sh_name()
2362 if (n->type == ROFFT_TEXT && in post_sh_name()
2363 n->string[0] == ',' && n->string[1] == '\0' && in post_sh_name()
2364 n->next != NULL && n->next->tok == MDOC_Nm) { in post_sh_name()
2365 n = n->next; in post_sh_name()
2371 n->line, n->pos, "%s", roff_name[n->tok]); in post_sh_name()
2388 const struct roff_node *n; in post_sh_see_also() local
2393 n = mdoc->last->child; in post_sh_see_also()
2395 while (n != NULL) { in post_sh_see_also()
2396 if (n->tok != MDOC_Xr || in post_sh_see_also()
2397 n->child == NULL || in post_sh_see_also()
2398 n->child->next == NULL) in post_sh_see_also()
2403 name = n->child->string; in post_sh_see_also()
2404 sec = n->child->next->string; in post_sh_see_also()
2407 mandoc_msg(MANDOCERR_XR_PUNCT, n->line, in post_sh_see_also()
2408 n->pos, "%s before %s(%s)", in post_sh_see_also()
2412 mandoc_msg(MANDOCERR_XR_ORDER, n->line, in post_sh_see_also()
2413 n->pos, "%s(%s) after %s(%s)", in post_sh_see_also()
2417 mandoc_msg(MANDOCERR_XR_ORDER, n->line, in post_sh_see_also()
2418 n->pos, "%s after %s", name, lastname); in post_sh_see_also()
2425 n = n->next; in post_sh_see_also()
2426 if (n == NULL) in post_sh_see_also()
2428 if (n->tok == MDOC_Xr) { in post_sh_see_also()
2432 if (n->type != ROFFT_TEXT) in post_sh_see_also()
2434 for (name = n->string; *name != '\0'; name++) in post_sh_see_also()
2437 lastpunct = n->string; in post_sh_see_also()
2438 if (n->next == NULL || n->next->tok == MDOC_Rs) in post_sh_see_also()
2439 mandoc_msg(MANDOCERR_XR_PUNCT, n->line, in post_sh_see_also()
2440 n->pos, "%s after %s(%s)", in post_sh_see_also()
2442 n = n->next; in post_sh_see_also()
2447 child_an(const struct roff_node *n) in child_an() argument
2450 for (n = n->child; n != NULL; n = n->next) in child_an()
2451 if ((n->tok == MDOC_An && n->child != NULL) || child_an(n)) in child_an()
2626 struct roff_node *n, *nch; in post_xr() local
2628 n = mdoc->last; in post_xr()
2629 nch = n->child; in post_xr()
2632 n->line, n->pos, "Xr %s", nch->string); in post_xr()
2634 assert(nch->next == n->last); in post_xr()
2647 struct roff_node *n, *nch; in post_section() local
2650 n = mdoc->last; in post_section()
2651 switch (n->type) { in post_section()
2657 deroff(&tag, n); in post_section()
2662 if ((nch = n->child) != NULL && in post_section()
2665 tag_put(NULL, TAG_STRONG, n); in post_section()
2667 tag_put(tag, TAG_FALLBACK, n); in post_section()
2678 if ((nch = n->child) != NULL && in post_section()
2683 roff_name[n->tok]); in post_section()
2686 if ((nch = n->last) != NULL && in post_section()
2690 roff_name[n->tok]); in post_section()
2698 struct roff_node *n, *np; in post_prevpar() local
2700 n = mdoc->last; in post_prevpar()
2701 if (n->type != ROFFT_ELEM && n->type != ROFFT_BLOCK) in post_prevpar()
2703 if ((np = roff_node_prev(n)) == NULL) in post_prevpar()
2713 if (n->tok == MDOC_Bl && n->norm->Bl.comp) in post_prevpar()
2715 if (n->tok == MDOC_Bd && n->norm->Bd.comp) in post_prevpar()
2717 if (n->tok == MDOC_It && n->parent->norm->Bl.comp) in post_prevpar()
2721 "%s before %s", roff_name[np->tok], roff_name[n->tok]); in post_prevpar()
2742 struct roff_node *n; in post_dd() local
2744 n = mdoc->last; in post_dd()
2745 n->flags |= NODE_NOPRT; in post_dd()
2748 mandoc_msg(MANDOCERR_PROLOG_REP, n->line, n->pos, "Dd"); in post_dd()
2751 mandoc_msg(MANDOCERR_PROLOG_LATE, n->line, n->pos, "Dd"); in post_dd()
2754 n->line, n->pos, "Dd after Dt"); in post_dd()
2757 n->line, n->pos, "Dd after Os"); in post_dd()
2759 if (mdoc->quick && n != NULL) in post_dd()
2762 mdoc->meta.date = mandoc_normdate(n->child, n); in post_dd()
2768 struct roff_node *nn, *n; in post_dt() local
2772 n = mdoc->last; in post_dt()
2773 n->flags |= NODE_NOPRT; in post_dt()
2776 mandoc_msg(MANDOCERR_DT_LATE, n->line, n->pos, "Dt"); in post_dt()
2781 mandoc_msg(MANDOCERR_PROLOG_REP, n->line, n->pos, "Dt"); in post_dt()
2784 n->line, n->pos, "Dt after Os"); in post_dt()
2798 nn = n->child; in post_dt()
2800 mandoc_msg(MANDOCERR_DT_NOTITLE, n->line, n->pos, "Dt"); in post_dt()
2822 mandoc_msg(MANDOCERR_MSEC_MISSING, n->line, n->pos, in post_dt()
2865 struct roff_node *n, *nch; in post_bx() local
2870 n = mdoc->last; in post_bx()
2871 nch = n->child; in post_bx()
2880 n->line, n->pos, "%s", macro); in post_bx()
2884 roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Ns); in post_bx()
2889 roff_word_alloc(mdoc, n->line, n->pos, "BSD"); in post_bx()
2893 mdoc->last = n; in post_bx()
2897 roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Ns); in post_bx()
2900 roff_word_alloc(mdoc, n->line, n->pos, "-"); in post_bx()
2902 roff_elem_alloc(mdoc, n->line, n->pos, MDOC_Ns); in post_bx()
2904 mdoc->last = n; in post_bx()
2921 struct roff_node *n; in post_os() local
2923 n = mdoc->last; in post_os()
2924 n->flags |= NODE_NOPRT; in post_os()
2927 mandoc_msg(MANDOCERR_PROLOG_REP, n->line, n->pos, "Os"); in post_os()
2929 mandoc_msg(MANDOCERR_PROLOG_LATE, n->line, n->pos, "Os"); in post_os()
2944 deroff(&mdoc->meta.os, n); in post_os()
2958 mandoc_msg(MANDOCERR_OS_UNAME, n->line, n->pos, "Os"); in post_os()
2981 if (n->child != NULL) in post_os()
2982 mandoc_msg(MANDOCERR_OS_ARG, n->child->line, n->child->pos, in post_os()
2983 "Os %s (%s)", n->child->string, in post_os()
2987 while (n->tok != MDOC_Dd) in post_os()
2988 if ((n = n->prev) == NULL) in post_os()
2990 if ((n = n->child) == NULL) in post_os()
2992 if (strncmp(n->string, "$" "Mdocdate", 9)) { in post_os()
2994 mandoc_msg(MANDOCERR_MDOCDATE_MISSING, n->line, in post_os()
2995 n->pos, "Dd %s (OpenBSD)", n->string); in post_os()
2998 mandoc_msg(MANDOCERR_MDOCDATE, n->line, in post_os()
2999 n->pos, "Dd %s (NetBSD)", n->string); in post_os()