summaryrefslogtreecommitdiffstatshomepage
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
commit218db5ce001eefed06c3063fd537a533b0f51046 (patch)
tree1200143cdc58903b6e16022e584f761939617a33
parentd4119897e8e1f98438694ef49e678e47661a3ae5 (diff)
downloadmandoc-218db5ce001eefed06c3063fd537a533b0f51046.tar.gz
mandoc-218db5ce001eefed06c3063fd537a533b0f51046.tar.zst
mandoc-218db5ce001eefed06c3063fd537a533b0f51046.zip
*** empty log message ***
-rw-r--r--argv.c6
-rw-r--r--validate.c20
2 files changed, 20 insertions, 6 deletions
diff --git a/argv.c b/argv.c
index 439ea011..9629ba6e 100644
--- a/argv.c
+++ b/argv.c
@@ -1,4 +1,4 @@
-/* $Id: argv.c,v 1.9 2009/01/08 14:55:59 kristaps Exp $ */
+/* $Id: argv.c,v 1.10 2009/01/09 15:07:04 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -411,8 +411,8 @@ mdoc_argv(struct mdoc *mdoc, int line, int tok,
buf[(*pos)++] = 0;
if (MDOC_ARG_MAX == (v->arg = lookup(tok, argv))) {
- (void)mdoc_perr(mdoc, line, i, ERR_SYNTAX_ARG);
- return(ARGV_ERROR);
+ (void)mdoc_pwarn(mdoc, line, i, WARN_SYNTAX_ARGLIKE);
+ return(ARGV_WORD);
}
while (buf[*pos] && isspace(buf[*pos]))
diff --git a/validate.c b/validate.c
index ca556197..754e9d93 100644
--- a/validate.c
+++ b/validate.c
@@ -1,4 +1,4 @@
-/* $Id: validate.c,v 1.21 2009/01/09 14:45:44 kristaps Exp $ */
+/* $Id: validate.c,v 1.22 2009/01/09 15:07:04 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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)
{