summaryrefslogtreecommitdiffstats
path: root/validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-09 15:07:04 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-09 15:07:04 +0000
commit769d4e324aa3e88fcd0dddab649abc5c15298d11 (patch)
tree26507249957b78470d5069ac3801ee05b12568d4 /validate.c
parentfb53bc928f34b334a138fad9fa6a6b9081a9f7c7 (diff)
downloadmandoc-769d4e324aa3e88fcd0dddab649abc5c15298d11.tar.gz
*** empty log message ***
Diffstat (limited to 'validate.c')
-rw-r--r--validate.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/validate.c b/validate.c
index 37291092..b9882b97 100644
--- a/validate.c
+++ b/validate.c
@@ -37,11 +37,14 @@ static int pre_prologue(struct mdoc *, struct mdoc_node *);
static int pre_prologue(struct mdoc *, struct mdoc_node *);
static int post_headchild_err_ge1(struct mdoc *);
static int post_elemchild_err_ge1(struct mdoc *);
+static int post_elemchild_warn_eq0(struct mdoc *);
static int post_bodychild_warn_ge1(struct mdoc *);
static int post_sh(struct mdoc *);
static v_post posts_sh[] = { post_headchild_err_ge1,
post_bodychild_warn_ge1, post_sh, NULL };
+static v_post posts_ss[] = { post_headchild_err_ge1, NULL };
+static v_post posts_pp[] = { post_elemchild_warn_eq0, NULL };
static v_post posts_dd[] = { post_elemchild_err_ge1, NULL };
@@ -51,8 +54,8 @@ const struct valids mdoc_valids[MDOC_MAX] = {
{ pre_prologue, NULL }, /* Dt */
{ pre_prologue, NULL }, /* Os */
{ NULL, posts_sh }, /* Sh */ /* FIXME: preceding Pp. */
- { NULL, NULL }, /* Ss */ /* FIXME: preceding Pp. */
- { NULL, NULL }, /* Pp */
+ { NULL, posts_ss }, /* Ss */ /* FIXME: preceding Pp. */
+ { NULL, posts_pp }, /* Pp */ /* FIXME: proceeding... */
{ NULL, NULL }, /* D1 */
{ NULL, NULL }, /* Dl */
{ NULL, NULL }, /* Bd */ /* FIXME: preceding Pp. */
@@ -169,6 +172,17 @@ post_bodychild_warn_ge1(struct mdoc *mdoc)
static int
+post_elemchild_warn_eq0(struct mdoc *mdoc)
+{
+
+ assert(MDOC_ELEM == mdoc->last->type);
+ if (NULL == mdoc->last->child)
+ return(1);
+ return(mdoc_warn(mdoc, WARN_ARGS_EQ0));
+}
+
+
+static int
post_elemchild_err_ge1(struct mdoc *mdoc)
{