diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-31 08:38:21 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-12-31 08:38:21 +0000 |
commit | f0d4886b46016e502843d08cf91ed8dc0e5bd086 (patch) | |
tree | 3b204fd3c3ee9b4cbda91678f7a24a1ebae8bfab /man_validate.c | |
parent | bb49c8a742a4e663709d44ec66f5eb01dbba930e (diff) | |
download | mandoc-f0d4886b46016e502843d08cf91ed8dc0e5bd086.tar.gz |
Use the new flag NODE_NOFILL in the validators, which is sometimes
simpler and always more robust. In particular, move the nesting
warnings for .EX and .EE from man_state(), where they were misplaced,
to the man(7) validator.
Diffstat (limited to 'man_validate.c')
-rw-r--r-- | man_validate.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/man_validate.c b/man_validate.c index 2aa6a244..1407d7f4 100644 --- a/man_validate.c +++ b/man_validate.c @@ -48,6 +48,8 @@ static void check_root(CHKARGS); static void check_text(CHKARGS); static void post_AT(CHKARGS); +static void post_EE(CHKARGS); +static void post_EX(CHKARGS); static void post_IP(CHKARGS); static void post_OP(CHKARGS); static void post_SH(CHKARGS); @@ -88,8 +90,8 @@ static const v_check man_valids[MAN_MAX - MAN_TH] = { NULL, /* SY */ NULL, /* YS */ post_OP, /* OP */ - NULL, /* EX */ - NULL, /* EE */ + post_EX, /* EX */ + post_EE, /* EE */ post_UR, /* UR */ NULL, /* UE */ post_UR, /* MT */ @@ -206,7 +208,7 @@ check_text(CHKARGS) { char *cp, *p; - if (man->flags & ROFF_NOFILL) + if (n->flags & NODE_NOFILL) return; cp = n->string; @@ -216,6 +218,20 @@ check_text(CHKARGS) } static void +post_EE(CHKARGS) +{ + if ((n->flags & NODE_NOFILL) == 0) + mandoc_msg(MANDOCERR_FI_SKIP, n->line, n->pos, "EE"); +} + +static void +post_EX(CHKARGS) +{ + if (n->flags & NODE_NOFILL) + mandoc_msg(MANDOCERR_NF_SKIP, n->line, n->pos, "EX"); +} + +static void post_OP(CHKARGS) { |