Lines Matching refs:n

43 #define	CHKARGS	  struct roff_man *man, struct roff_node *n
111 struct roff_node *n; in man_validate() local
119 n = man->last; in man_validate()
120 switch (n->tok) { in man_validate()
123 n->tok = MAN_PP; in man_validate()
137 if (man->last == n) in man_validate()
145 man->last = n; in man_validate()
147 switch (n->type) { in man_validate()
149 check_text(man, n); in man_validate()
152 check_root(man, n); in man_validate()
159 if (n->tok < ROFF_MAX) { in man_validate()
163 assert(n->tok >= MAN_TH && n->tok < MAN_MAX); in man_validate()
164 cp = man_valids + (n->tok - MAN_TH); in man_validate()
166 (*cp)(man, n); in man_validate()
167 if (man->last == n) in man_validate()
168 n->flags |= NODE_VALID; in man_validate()
178 if (n->last == NULL || n->last->type == ROFFT_COMMENT) in check_root()
179 mandoc_msg(MANDOCERR_DOC_EMPTY, n->line, n->pos, NULL); in check_root()
184 mandoc_msg(MANDOCERR_TH_NOTITLE, n->line, n->pos, NULL); in check_root()
215 check_tag(struct roff_node *n, struct roff_node *nt) in check_tag() argument
265 tag_put(cp, prio, n); in check_tag()
276 if (n->flags & NODE_NOFILL) in check_text()
279 cp = n->string; in check_text()
282 n->line, n->pos + (int)(p - cp), NULL); in check_text()
288 if ((n->flags & NODE_NOFILL) == 0) in post_EE()
289 mandoc_msg(MANDOCERR_FI_SKIP, n->line, n->pos, "EE"); in post_EE()
295 if (n->flags & NODE_NOFILL) in post_EX()
296 mandoc_msg(MANDOCERR_NF_SKIP, n->line, n->pos, "EX"); in post_EX()
303 if (n->child == NULL) in post_OP()
304 mandoc_msg(MANDOCERR_OP_EMPTY, n->line, n->pos, "OP"); in post_OP()
305 else if (n->child->next != NULL && n->child->next->next != NULL) { in post_OP()
306 n = n->child->next->next; in post_OP()
308 n->line, n->pos, "OP ... %s", n->string); in post_OP()
318 nc = n->child; in post_SH()
319 switch (n->type) { in post_SH()
322 deroff(&tag, n); in post_SH()
329 tag_put(NULL, TAG_STRONG, n); in post_SH()
331 tag_put(tag, TAG_FALLBACK, n); in post_SH()
347 man->last = n; in post_SH()
353 "%s after %s", roff_name[nc->tok], roff_name[n->tok]); in post_SH()
362 if ((nc = n->last) != NULL && nc->tok == ROFF_br) { in post_SH()
365 roff_name[nc->tok], roff_name[n->tok]); in post_SH()
373 if (n->type == ROFFT_HEAD && n->child == NULL) in post_UR()
374 mandoc_msg(MANDOCERR_UR_NOHEAD, n->line, n->pos, in post_UR()
375 "%s", roff_name[n->tok]); in post_UR()
376 check_part(man, n); in post_UR()
383 if (n->type == ROFFT_BODY && n->child == NULL) in check_part()
384 mandoc_msg(MANDOCERR_BLK_EMPTY, n->line, n->pos, in check_part()
385 "%s", roff_name[n->tok]); in check_part()
392 switch (n->type) { in check_par()
394 if (n->body->child == NULL) in check_par()
395 roff_node_delete(man, n); in check_par()
398 if (n->child != NULL && in check_par()
399 (n->child->tok == ROFF_sp || n->child->tok == ROFF_br)) { in check_par()
401 n->child->line, n->child->pos, in check_par()
402 "%s after %s", roff_name[n->child->tok], in check_par()
403 roff_name[n->tok]); in check_par()
404 roff_node_delete(man, n->child); in check_par()
406 if (n->child == NULL) in check_par()
407 mandoc_msg(MANDOCERR_PAR_SKIP, n->line, n->pos, in check_par()
408 "%s empty", roff_name[n->tok]); in check_par()
411 if (n->child != NULL) in check_par()
413 n->line, n->pos, "%s %s%s", in check_par()
414 roff_name[n->tok], n->child->string, in check_par()
415 n->child->next != NULL ? " ..." : ""); in check_par()
425 switch (n->type) { in post_IP()
427 if (n->head->child == NULL && n->body->child == NULL) in post_IP()
428 roff_node_delete(man, n); in post_IP()
431 check_tag(n, n->child); in post_IP()
434 if (n->parent->head->child == NULL && n->child == NULL) in post_IP()
435 mandoc_msg(MANDOCERR_PAR_SKIP, n->line, n->pos, in post_IP()
436 "%s empty", roff_name[n->tok]); in post_IP()
452 if (n->type != ROFFT_HEAD || (nt = n->child) == NULL) in post_TP()
471 check_tag(n, nt); in post_TP()
489 nb = n; in post_TH()
493 n = n->child; in post_TH()
494 if (n != NULL && n->string != NULL) { in post_TH()
495 for (p = n->string; *p != '\0'; p++) { in post_TH()
499 mandoc_msg(MANDOCERR_TITLE_CASE, n->line, in post_TH()
500 n->pos + (int)(p - n->string), in post_TH()
501 "TH %s", n->string); in post_TH()
505 man->meta.title = mandoc_strdup(n->string); in post_TH()
513 if (n != NULL) in post_TH()
514 n = n->next; in post_TH()
515 if (n != NULL && n->string != NULL) { in post_TH()
516 man->meta.msec = mandoc_strdup(n->string); in post_TH()
518 man->filesec != *n->string && in post_TH()
519 *n->string >= '1' && *n->string <= '9') in post_TH()
520 mandoc_msg(MANDOCERR_MSEC_FILE, n->line, n->pos, in post_TH()
521 "*.%c vs TH ... %c", man->filesec, *n->string); in post_TH()
530 if (n != NULL) in post_TH()
531 n = n->next; in post_TH()
532 if (man->quick && n != NULL) in post_TH()
535 man->meta.date = mandoc_normdate(n, nb); in post_TH()
539 if (n && (n = n->next)) in post_TH()
540 man->meta.os = mandoc_strdup(n->string); in post_TH()
553 if (n && (n = n->next)) in post_TH()
554 man->meta.vol = mandoc_strdup(n->string); in post_TH()
559 if (n != NULL && (n = n->next) != NULL) in post_TH()
561 n->line, n->pos, "TH ... %s", n->string); in post_TH()
583 n = n->child; in post_UC()
585 if (n == NULL || n->type != ROFFT_TEXT) in post_UC()
588 s = n->string; in post_UC()
620 n = n->child; in post_AT()
622 if (n == NULL || n->type != ROFFT_TEXT) in post_AT()
625 s = n->string; in post_AT()
631 nn = n->next; in post_AT()
651 if (n->parent->tok != MAN_TP || in post_in()
652 n->parent->type != ROFFT_HEAD || in post_in()
653 n->child == NULL || in post_in()
654 *n->child->string == '+' || in post_in()
655 *n->child->string == '-') in post_in()
657 mandoc_asprintf(&s, "+%s", n->child->string); in post_in()
658 free(n->child->string); in post_in()
659 n->child->string = s; in post_in()