From 53029bcbfbab6179bd9e52c6d23fca731cf598d8 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 31 Dec 2018 08:38:21 +0000 Subject: 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. --- man_validate.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'man_validate.c') diff --git a/man_validate.c b/man_validate.c index 208b7d24..253aca35 100644 --- a/man_validate.c +++ b/man_validate.c @@ -1,4 +1,4 @@ -/* $Id: man_validate.c,v 1.144 2018/12/31 07:08:12 schwarze Exp $ */ +/* $Id: man_validate.c,v 1.145 2018/12/31 08:38:21 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2018 Ingo Schwarze @@ -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; @@ -215,6 +217,20 @@ check_text(CHKARGS) n->line, n->pos + (int)(p - cp), NULL); } +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) { -- cgit v1.2.3-56-ge451