summaryrefslogtreecommitdiffstats
path: root/macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-16 14:04:26 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-16 14:04:26 +0000
commit62f5a205ef4f4e41edb0f430f581d7faddddd583 (patch)
tree5434fe660ebca235f2fd4090c123a96542c8600b /macro.c
parentd460b17b87e787b48938270b20eb4088e5c343ab (diff)
downloadmandoc-62f5a205ef4f4e41edb0f430f581d7faddddd583.tar.gz
Added more validation (parents/msecs).
Initial function documentation for mdoc.3.
Diffstat (limited to 'macro.c')
-rw-r--r--macro.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/macro.c b/macro.c
index 967f18fb..0b202d64 100644
--- a/macro.c
+++ b/macro.c
@@ -950,6 +950,8 @@ macro_constant_delimited(MACRO_PROT_ARGS)
/* FALLTHROUGH */
case (MDOC_Ns):
/* FALLTHROUGH */
+ case (MDOC_Pf):
+ /* FALLTHROUGH */
case (MDOC_Ux):
/* FALLTHROUGH */
case (MDOC_St):
@@ -1044,8 +1046,6 @@ macro_constant(MACRO_PROT_ARGS)
struct mdoc_arg argv[MDOC_LINEARG_MAX];
char *p;
- /* FIXME: parsing macros! */
-
fl = 0;
if (MDOC_QUOTABLE & mdoc_macros[tok].flags)
fl = ARGS_QUOTED;
@@ -1084,6 +1084,15 @@ macro_constant(MACRO_PROT_ARGS)
if (ARGS_EOLN == c)
break;
+ if (-1 == (c = lookup(mdoc, line, lastarg, tok, p)))
+ return(0);
+ else if (MDOC_MAX != c) {
+ if ( ! rewind_elem(mdoc, tok))
+ return(0);
+ return(mdoc_macro(mdoc, c, line,
+ lastarg, pos, buf));
+ }
+
if ( ! mdoc_word_alloc(mdoc, line, lastarg, p))
return(0);
mdoc->next = MDOC_NEXT_SIBLING;