=================================================================== RCS file: /cvs/mandoc/Attic/macro.c,v retrieving revision 1.32 retrieving revision 1.34 diff -u -p -r1.32 -r1.34 --- mandoc/Attic/macro.c 2009/01/12 12:52:21 1.32 +++ mandoc/Attic/macro.c 2009/01/12 17:26:42 1.34 @@ -1,4 +1,4 @@ -/* $Id: macro.c,v 1.32 2009/01/12 12:52:21 kristaps Exp $ */ +/* $Id: macro.c,v 1.34 2009/01/12 17:26:42 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -68,6 +68,8 @@ rewind_last(struct mdoc *mdoc, struct mdoc_node *to) return(0); if ( ! mdoc_action_post(mdoc)) return(0); + mdoc_msg(mdoc, "rewound to %s", + mdoc_macronames[mdoc->last->tok]); return(1); } @@ -78,6 +80,8 @@ rewind_last(struct mdoc *mdoc, struct mdoc_node *to) return(0); if ( ! mdoc_action_post(mdoc)) return(0); + mdoc_msg(mdoc, "rewound to %s", + mdoc_macronames[mdoc->last->tok]); } while (mdoc->last != to); return(1); @@ -109,11 +113,10 @@ rewind_body(struct mdoc *mdoc, int tok) /* LINTED */ for (n = mdoc->last; n; n = n->parent) { - if (MDOC_BODY != n->type) - continue; - if (tok == (t = n->tok)) + t = n->tok; + if (MDOC_BODY == n->type && tok == t) break; - if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags)) + if (MDOC_NESTED & mdoc_macros[t].flags) continue; return(mdoc_verr(mdoc, n, ERR_SCOPE_BREAK)); } @@ -133,11 +136,10 @@ rewind_head(struct mdoc *mdoc, int tok) /* LINTED */ for (n = mdoc->last; n; n = n->parent) { - if (MDOC_HEAD != n->type) - continue; - if (tok == (t = n->tok)) + t = n->tok; + if (MDOC_HEAD == n->type && tok == t) break; - if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags)) + if (MDOC_NESTED & mdoc_macros[t].flags) continue; return(mdoc_verr(mdoc, n, ERR_SCOPE_BREAK)); } @@ -157,9 +159,8 @@ rewind_expblock(struct mdoc *mdoc, int tok) /* LINTED */ for ( ; n; n = n->parent) { - if (MDOC_BLOCK != n->type) - continue; - if (tok == (t = n->tok)) + t = n->tok; + if (MDOC_BLOCK == n->type && tok == t) break; if (MDOC_NESTED & mdoc_macros[t].flags) continue; @@ -181,9 +182,8 @@ rewind_impblock(struct mdoc *mdoc, int tok) /* LINTED */ for ( ; n; n = n->parent) { - if (MDOC_BLOCK != n->type) - continue; - if (tok == (t = n->tok)) + t = n->tok; + if (MDOC_BLOCK == n->type && tok == t) break; if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags)) continue; @@ -479,7 +479,7 @@ macro_text(MACRO_PROT_ARGS) int macro_scoped(MACRO_PROT_ARGS) { - int c, lastarg, argc, j; + int c, lastarg, argc, j, fl; struct mdoc_arg argv[MDOC_LINEARG_MAX]; char *p; @@ -529,9 +529,13 @@ macro_scoped(MACRO_PROT_ARGS) return(0); mdoc->next = MDOC_NEXT_CHILD; + fl = ARGS_DELIM; + if (MDOC_TABSEP & mdoc_macros[tok].flags) + fl |= ARGS_TABSEP; + for (j = 0; j < MDOC_LINEARG_MAX; j++) { lastarg = *pos; - c = mdoc_args(mdoc, line, pos, buf, ARGS_DELIM, &p); + c = mdoc_args(mdoc, line, pos, buf, fl, &p); if (ARGS_ERROR == c) return(0);