aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--mandoc.112
-rw-r--r--mandoc.h3
-rw-r--r--mdoc_validate.c31
-rw-r--r--read.c3
4 files changed, 43 insertions, 6 deletions
diff --git a/mandoc.1 b/mandoc.1
index e280a262..3773ce94 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc.1,v 1.116 2014/10/10 08:44:24 kristaps Exp $
+.\" $Id: mandoc.1,v 1.117 2014/10/11 21:14:16 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2012, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: October 10 2014 $
+.Dd $Mdocdate: October 11 2014 $
.Dt MANDOC 1
.Os
.Sh NAME
@@ -1120,6 +1120,14 @@ An argument of an
or
.Ic \&Fn
macro contains a comma; it should probably be split into two arguments.
+.It Sy "parenthesis in function name"
+.Pq mdoc
+The first argument of an
+.Ic \&Fc
+or
+.Ic \&Fn
+macro contains an opening or closing parenthesis; that's probably wrong,
+parentheses are added automatically.
.It Sy "invalid content in Rs block"
.Pq mdoc
An
diff --git a/mandoc.h b/mandoc.h
index 6af825a7..e797f2f5 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,4 +1,4 @@
-/* $Id: mandoc.h,v 1.160 2014/10/10 15:26:29 schwarze Exp $ */
+/* $Id: mandoc.h,v 1.161 2014/10/11 21:14:16 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -114,6 +114,7 @@ enum mandocerr {
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_FN_PAREN, /* parenthesis in function name: 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 a566ad00..f2e85a36 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.249 2014/09/12 00:54:10 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.250 2014/10/11 21:14:16 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -101,6 +101,8 @@ 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_fn(POST_ARGS);
+static int post_fname(POST_ARGS);
static int post_fo(POST_ARGS);
static int post_hyph(POST_ARGS);
static int post_hyphtext(POST_ARGS);
@@ -161,7 +163,7 @@ static const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, post_fa }, /* Fa */
{ NULL, ewarn_ge1 }, /* Fd */
{ NULL, NULL }, /* Fl */
- { NULL, post_fa }, /* Fn */
+ { NULL, post_fn }, /* Fn */
{ NULL, NULL }, /* Ft */
{ NULL, NULL }, /* Ic */
{ NULL, ewarn_eq1 }, /* In */
@@ -1000,11 +1002,36 @@ post_eoln(POST_ARGS)
}
static int
+post_fname(POST_ARGS)
+{
+ const struct mdoc_node *n;
+ size_t pos;
+
+ n = mdoc->last->child;
+ pos = strcspn(n->string, "()");
+ if (n->string[pos] != '\0')
+ mandoc_msg(MANDOCERR_FN_PAREN, mdoc->parse,
+ n->line, n->pos + pos, n->string);
+ return(1);
+}
+
+static int
+post_fn(POST_ARGS)
+{
+
+ post_fname(mdoc);
+ post_fa(mdoc);
+ return(1);
+}
+
+static int
post_fo(POST_ARGS)
{
hwarn_eq1(mdoc);
bwarn_ge1(mdoc);
+ if (mdoc->last->type == MDOC_HEAD)
+ post_fname(mdoc);
return(1);
}
diff --git a/read.c b/read.c
index f6e88ce8..f4a24a25 100644
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.88 2014/09/12 00:54:10 schwarze Exp $ */
+/* $Id: read.c,v 1.89 2014/10/11 21:14:16 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -159,6 +159,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
"skipping -width argument",
"unknown AT&T UNIX version",
"comma in function argument",
+ "parenthesis in function name",
"invalid content in Rs block",
"invalid Boolean argument",
"unknown font, skipping request",