Lines Matching refs:n

44 #define	CHKARGS	  struct roff_man *man, struct roff_node *n
113 struct roff_node *n; in man_validate() local
121 n = man->last; in man_validate()
125 if (man->last == n) in man_validate()
133 man->last = n; in man_validate()
135 switch (n->type) { in man_validate()
137 check_text(man, n); in man_validate()
140 check_root(man, n); in man_validate()
147 if (n->tok < ROFF_MAX) { in man_validate()
151 assert(n->tok >= MAN_TH && n->tok < MAN_MAX); in man_validate()
152 cp = man_valids + (n->tok - MAN_TH); in man_validate()
154 (*cp)(man, n); in man_validate()
155 if (man->last == n) in man_validate()
156 n->flags |= NODE_VALID; in man_validate()
166 if (n->last == NULL || n->last->type == ROFFT_COMMENT) in check_root()
167 mandoc_msg(MANDOCERR_DOC_EMPTY, n->line, n->pos, NULL); in check_root()
172 mandoc_msg(MANDOCERR_TH_NOTITLE, n->line, n->pos, NULL); in check_root()
197 check_tag(struct roff_node *n, struct roff_node *nt) in check_tag() argument
247 tag_put(cp, prio, n); in check_tag()
258 if (n->flags & NODE_NOFILL) in check_text()
261 cp = n->string; in check_text()
264 n->line, n->pos + (int)(p - cp), NULL); in check_text()
270 if ((n->flags & NODE_NOFILL) == 0) in post_EE()
271 mandoc_msg(MANDOCERR_FI_SKIP, n->line, n->pos, "EE"); in post_EE()
277 if (n->flags & NODE_NOFILL) in post_EX()
278 mandoc_msg(MANDOCERR_NF_SKIP, n->line, n->pos, "EX"); in post_EX()
285 if (n->child == NULL) in post_OP()
286 mandoc_msg(MANDOCERR_OP_EMPTY, n->line, n->pos, "OP"); in post_OP()
287 else if (n->child->next != NULL && n->child->next->next != NULL) { in post_OP()
288 n = n->child->next->next; in post_OP()
290 n->line, n->pos, "OP ... %s", n->string); in post_OP()
300 nc = n->child; in post_SH()
301 switch (n->type) { in post_SH()
304 deroff(&tag, n); in post_SH()
311 tag_put(NULL, TAG_STRONG, n); in post_SH()
313 tag_put(tag, TAG_FALLBACK, n); in post_SH()
330 man->last = n; in post_SH()
337 "%s after %s", roff_name[nc->tok], roff_name[n->tok]); in post_SH()
346 if ((nc = n->last) != NULL && nc->tok == ROFF_br) { in post_SH()
349 roff_name[nc->tok], roff_name[n->tok]); in post_SH()
357 if (n->type == ROFFT_HEAD && n->child == NULL) in post_UR()
358 mandoc_msg(MANDOCERR_UR_NOHEAD, n->line, n->pos, in post_UR()
359 "%s", roff_name[n->tok]); in post_UR()
365 if (n->type == ROFFT_BODY && n->child == NULL) in check_part()
366 mandoc_msg(MANDOCERR_BLK_EMPTY, n->line, n->pos, in check_part()
367 "%s", roff_name[n->tok]); in check_part()
374 switch (n->type) { in check_par()
376 if (n->body->child == NULL) in check_par()
377 roff_node_delete(man, n); in check_par()
380 if (n->child != NULL && in check_par()
381 (n->child->tok == ROFF_sp || n->child->tok == ROFF_br)) { in check_par()
383 n->child->line, n->child->pos, in check_par()
384 "%s after %s", roff_name[n->child->tok], in check_par()
385 roff_name[n->tok]); in check_par()
386 roff_node_delete(man, n->child); in check_par()
388 if (n->child == NULL) in check_par()
389 mandoc_msg(MANDOCERR_PAR_SKIP, n->line, n->pos, in check_par()
390 "%s empty", roff_name[n->tok]); in check_par()
393 if (n->child != NULL) in check_par()
395 n->line, n->pos, "%s %s%s", in check_par()
396 roff_name[n->tok], n->child->string, in check_par()
397 n->child->next != NULL ? " ..." : ""); in check_par()
407 switch (n->type) { in post_IP()
409 if (n->head->child == NULL && n->body->child == NULL) in post_IP()
410 roff_node_delete(man, n); in post_IP()
413 check_tag(n, n->child); in post_IP()
416 if (n->parent->head->child == NULL && n->child == NULL) in post_IP()
417 mandoc_msg(MANDOCERR_PAR_SKIP, n->line, n->pos, in post_IP()
418 "%s empty", roff_name[n->tok]); in post_IP()
434 if (n->type != ROFFT_HEAD || (nt = n->child) == NULL) in post_TP()
453 check_tag(n, nt); in post_TP()
471 nb = n; in post_TH()
475 n = n->child; in post_TH()
476 if (n != NULL && n->string != NULL) { in post_TH()
477 for (p = n->string; *p != '\0'; p++) { in post_TH()
481 mandoc_msg(MANDOCERR_TITLE_CASE, n->line, in post_TH()
482 n->pos + (int)(p - n->string), in post_TH()
483 "TH %s", n->string); in post_TH()
487 man->meta.title = mandoc_strdup(n->string); in post_TH()
495 if (n != NULL) in post_TH()
496 n = n->next; in post_TH()
497 if (n != NULL && n->string != NULL) { in post_TH()
498 man->meta.msec = mandoc_strdup(n->string); in post_TH()
500 man->filesec != *n->string && in post_TH()
501 *n->string >= '1' && *n->string <= '9') in post_TH()
502 mandoc_msg(MANDOCERR_MSEC_FILE, n->line, n->pos, in post_TH()
503 "*.%c vs TH ... %c", man->filesec, *n->string); in post_TH()
512 if (n != NULL) in post_TH()
513 n = n->next; in post_TH()
514 if (man->quick && n != NULL) in post_TH()
517 man->meta.date = mandoc_normdate(n, nb); in post_TH()
521 if (n && (n = n->next)) in post_TH()
522 man->meta.os = mandoc_strdup(n->string); in post_TH()
535 if (n && (n = n->next)) in post_TH()
536 man->meta.vol = mandoc_strdup(n->string); in post_TH()
541 if (n != NULL && (n = n->next) != NULL) in post_TH()
543 n->line, n->pos, "TH ... %s", n->string); in post_TH()
557 if ((nch = n->child) == NULL) { in post_MR()
558 mandoc_msg(MANDOCERR_NM_NONAME, n->line, n->pos, "MR"); in post_MR()
563 n->line, n->pos, "MR %s", nch->string); in post_MR()
591 n = n->child; in post_UC()
593 if (n == NULL || n->type != ROFFT_TEXT) in post_UC()
596 s = n->string; in post_UC()
628 n = n->child; in post_AT()
630 if (n == NULL || n->type != ROFFT_TEXT) in post_AT()
633 s = n->string; in post_AT()
639 nn = n->next; in post_AT()
659 if (n->parent->tok != MAN_TP || in post_in()
660 n->parent->type != ROFFT_HEAD || in post_in()
661 n->child == NULL || in post_in()
662 *n->child->string == '+' || in post_in()
663 *n->child->string == '-') in post_in()
665 mandoc_asprintf(&s, "+%s", n->child->string); in post_in()
666 free(n->child->string); in post_in()
667 n->child->string = s; in post_in()