summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-17 11:02:06 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-17 11:02:06 +0000
commitc7816e955bad4c17d5247b680ac8db55911b8a53 (patch)
treeaeb2828a8c5cd7279fa43bdf8d985af3ac76dca8
parent08234e1261b84672fa81eab4dd6640e9b55e2f63 (diff)
downloadmandoc-c7816e955bad4c17d5247b680ac8db55911b8a53.tar.gz
Cleaned up .Bf validator.
-rw-r--r--mdoc_argv.c2
-rw-r--r--mdoc_validate.c31
2 files changed, 15 insertions, 18 deletions
diff --git a/mdoc_argv.c b/mdoc_argv.c
index cae37572..9339dc8e 100644
--- a/mdoc_argv.c
+++ b/mdoc_argv.c
@@ -32,6 +32,8 @@
* There's no limit to the number or arguments that may be allocated.
*/
+/* FIXME .Bf Li raises "macro-like parameter". */
+
#define ARGS_QUOTED (1 << 0)
#define ARGS_DELIM (1 << 1)
#define ARGS_TABSEP (1 << 2)
diff --git a/mdoc_validate.c b/mdoc_validate.c
index edc03a41..c58703b5 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1072,31 +1072,26 @@ post_bf(POST_ARGS)
if (MDOC_BLOCK != mdoc->last->type)
return(1);
- /* FIXME: clean-up .*/
-
head = mdoc->last->head;
if (mdoc->last->args && head->child)
+ return(mdoc_err(mdoc, "one argument expected"));
+ else if (mdoc->last->args)
+ return(1);
- if (NULL == mdoc->last->args) {
- if (NULL == head->child ||
- MDOC_TEXT != head->child->type)
- return(mdoc_err(mdoc, "text argument expected"));
+ if (NULL == head->child || MDOC_TEXT != head->child->type)
+ return(mdoc_err(mdoc, "text argument expected"));
- p = head->child->string;
- if (0 == strcmp(p, "Em"))
- return(1);
- else if (0 == strcmp(p, "Li"))
- return(1);
- else if (0 == strcmp(p, "Sm"))
- return(1);
- return(mdoc_nerr(mdoc, head->child, "invalid font"));
- }
+ p = head->child->string;
- if (head->child)
- return(mdoc_err(mdoc, "one argument expected"));
+ if (0 == strcmp(p, "Em"))
+ return(1);
+ else if (0 == strcmp(p, "Li"))
+ return(1);
+ else if (0 == strcmp(p, "Sm"))
+ return(1);
- return(1);
+ return(mdoc_nerr(mdoc, head->child, "invalid font mode"));
}