aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--mandoc.19
-rw-r--r--mandoc.h3
-rw-r--r--mdoc_validate.c29
-rw-r--r--read.c3
4 files changed, 38 insertions, 6 deletions
diff --git a/mandoc.1 b/mandoc.1
index 2c5dccbc..966c97e7 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc.1,v 1.112 2014/09/12 00:10:26 schwarze Exp $
+.\" $Id: mandoc.1,v 1.113 2014/09/12 00:54:10 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2012, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -1118,6 +1118,13 @@ macro has an invalid argument.
It is used verbatim, with
.Qq "AT&T UNIX "
prefixed to it.
+.It Sy "comma in function argument"
+.Pq mdoc
+An argument of an
+.Ic \&Fa
+or
+.Ic \&Fn
+macro contains a comma; it should probably be split into two arguments.
.It Sy "invalid content in Rs block"
.Pq mdoc
An
diff --git a/mandoc.h b/mandoc.h
index 15098a4c..56fd1bb2 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.155 2014/09/11 23:53:30 schwarze Exp $ */
+/* $Id: mandoc.h,v 1.156 2014/09/12 00:54:10 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -113,6 +113,7 @@ enum mandocerr {
MANDOCERR_BL_REP, /* skipping duplicate list type: Bl -type */
MANDOCERR_BL_SKIPW, /* skipping -width argument: Bl -type */
MANDOCERR_AT_BAD, /* unknown AT&T UNIX version: At version */
+ MANDOCERR_FA_COMMA, /* comma in function argument: arg */
MANDOCERR_RS_BAD, /* invalid content in Rs block: macro */
MANDOCERR_SM_BAD, /* invalid Boolean argument: macro arg */
MANDOCERR_FT_BAD, /* unknown font, skipping request: ft font */
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 913168e5..a566ad00 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.248 2014/09/11 23:53:30 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.249 2014/09/12 00:54:10 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -100,6 +100,7 @@ static int post_en(POST_ARGS);
static int post_es(POST_ARGS);
static int post_eoln(POST_ARGS);
static int post_ex(POST_ARGS);
+static int post_fa(POST_ARGS);
static int post_fo(POST_ARGS);
static int post_hyph(POST_ARGS);
static int post_hyphtext(POST_ARGS);
@@ -157,10 +158,10 @@ static const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, NULL }, /* Er */
{ NULL, NULL }, /* Ev */
{ pre_std, post_ex }, /* Ex */
- { NULL, NULL }, /* Fa */
+ { NULL, post_fa }, /* Fa */
{ NULL, ewarn_ge1 }, /* Fd */
{ NULL, NULL }, /* Fl */
- { NULL, NULL }, /* Fn */
+ { NULL, post_fa }, /* Fn */
{ NULL, NULL }, /* Ft */
{ NULL, NULL }, /* Ic */
{ NULL, ewarn_eq1 }, /* In */
@@ -1008,6 +1009,28 @@ post_fo(POST_ARGS)
}
static int
+post_fa(POST_ARGS)
+{
+ const struct mdoc_node *n;
+ const char *cp;
+
+ for (n = mdoc->last->child; n != NULL; n = n->next) {
+ for (cp = n->string; *cp != '\0'; cp++) {
+ /* Ignore callbacks and alterations. */
+ if (*cp == '(' || *cp == '{')
+ break;
+ if (*cp != ',')
+ continue;
+ mandoc_msg(MANDOCERR_FA_COMMA, mdoc->parse,
+ n->line, n->pos + (cp - n->string),
+ n->string);
+ break;
+ }
+ }
+ return(1);
+}
+
+static int
post_vt(POST_ARGS)
{
const struct mdoc_node *n;
diff --git a/read.c b/read.c
index 31645ecf..f6e88ce8 100644
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.87 2014/09/11 23:53:30 schwarze Exp $ */
+/* $Id: read.c,v 1.88 2014/09/12 00:54:10 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -158,6 +158,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
"skipping duplicate list type",
"skipping -width argument",
"unknown AT&T UNIX version",
+ "comma in function argument",
"invalid content in Rs block",
"invalid Boolean argument",
"unknown font, skipping request",