From d64b8bc446959390d2d3284f867bca8f924003e2 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Fri, 16 Jan 2009 14:04:26 +0000 Subject: Added more validation (parents/msecs). Initial function documentation for mdoc.3. --- macro.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'macro.c') diff --git a/macro.c b/macro.c index d87e2dd7..ae7dfec0 100644 --- a/macro.c +++ b/macro.c @@ -1,4 +1,4 @@ -/* $Id: macro.c,v 1.38 2009/01/16 11:50:54 kristaps Exp $ */ +/* $Id: macro.c,v 1.39 2009/01/16 14:04:26 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -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; -- cgit v1.2.3