-/* $Id: mdoc_argv.c,v 1.5 2009/06/16 19:45:51 kristaps Exp $ */
+/* $Id: mdoc_argv.c,v 1.6 2009/06/17 11:02:06 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
* 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)
-/* $Id: mdoc_validate.c,v 1.12 2009/06/17 10:53:32 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.13 2009/06/17 11:02:06 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
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"));
}