=================================================================== RCS file: /cvs/mandoc/mdoc_macro.c,v retrieving revision 1.56 retrieving revision 1.58 diff -u -p -r1.56 -r1.58 --- mandoc/mdoc_macro.c 2010/05/07 05:54:09 1.56 +++ mandoc/mdoc_macro.c 2010/05/08 07:30:19 1.58 @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.56 2010/05/07 05:54:09 kristaps Exp $ */ +/* $Id: mdoc_macro.c,v 1.58 2010/05/08 07:30:19 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -45,7 +45,7 @@ static int obsolete(MACRO_PROT_ARGS); static int append_delims(struct mdoc *, int, int *, char *); -static enum mdoct lookup(int, const char *); +static enum mdoct lookup(enum mdoct, const char *); static enum mdoct lookup_raw(const char *); static int phrase(struct mdoc *, int, int, char *); static enum mdoct rew_alt(enum mdoct); @@ -267,7 +267,7 @@ mdoc_macroend(struct mdoc *m) * Look up a macro from within a subsequent context. */ static enum mdoct -lookup(int from, const char *p) +lookup(enum mdoct from, const char *p) { /* FIXME: make -diag lists be un-PARSED. */ @@ -283,7 +283,7 @@ lookup(int from, const char *p) static enum mdoct lookup_raw(const char *p) { - int res; + enum mdoct res; if (MDOC_MAX == (res = mdoc_hash_find(p))) return(MDOC_MAX); @@ -632,7 +632,6 @@ append_delims(struct mdoc *mdoc, int line, int *pos, c for (;;) { lastarg = *pos; ac = mdoc_zargs(mdoc, line, pos, buf, ARGS_NOWARN, &p); - assert(ARGS_PHRASE != ac); if (ARGS_ERROR == ac) return(0); @@ -965,6 +964,7 @@ blk_full(MACRO_PROT_ARGS) /* Don't emit leading punct. for phrases. */ if (NULL == head && ARGS_PHRASE != ac && + ARGS_PPHRASE != ac && ARGS_QWORD != ac && 1 == mdoc_isdelim(p)) { if ( ! mdoc_word_alloc(m, line, la, p)) @@ -974,13 +974,14 @@ blk_full(MACRO_PROT_ARGS) /* Always re-open head for phrases. */ - if (NULL == head || ARGS_PHRASE == ac) { + if (NULL == head || ARGS_PHRASE == ac || + ARGS_PPHRASE == ac) { if ( ! mdoc_head_alloc(m, line, ppos, tok)) return(0); head = m->last; } - if (ARGS_PHRASE == ac) { + if (ARGS_PHRASE == ac || ARGS_PPHRASE == ac) { if ( ! phrase(m, line, la, buf)) return(0); if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos)) @@ -1084,8 +1085,6 @@ blk_part_imp(MACRO_PROT_ARGS) la = *pos; ac = mdoc_args(m, line, pos, buf, tok, &p); - assert(ARGS_PHRASE != ac); - if (ARGS_ERROR == ac) return(0); if (ARGS_EOLN == ac) @@ -1186,8 +1185,6 @@ blk_part_exp(MACRO_PROT_ARGS) break; if (ARGS_EOLN == ac) break; - - assert(ARGS_PHRASE != ac); /* Flush out leading punctuation. */