=================================================================== RCS file: /cvs/mandoc/mdoc_macro.c,v retrieving revision 1.55 retrieving revision 1.57 diff -u -p -r1.55 -r1.57 --- mandoc/mdoc_macro.c 2010/05/07 05:48:29 1.55 +++ mandoc/mdoc_macro.c 2010/05/07 06:05:38 1.57 @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.55 2010/05/07 05:48:29 kristaps Exp $ */ +/* $Id: mdoc_macro.c,v 1.57 2010/05/07 06:05:38 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -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); @@ -732,7 +731,8 @@ blk_exp_close(MACRO_PROT_ARGS) static int in_line(MACRO_PROT_ARGS) { - int la, lastpunct, c, cnt, d, nc; + int la, lastpunct, cnt, d, nc; + enum margverr av; enum mdoct ntok; enum margserr ac; struct mdoc_arg *arg; @@ -764,15 +764,15 @@ in_line(MACRO_PROT_ARGS) for (arg = NULL;; ) { la = *pos; - c = mdoc_argv(m, line, tok, &arg, pos, buf); + av = mdoc_argv(m, line, tok, &arg, pos, buf); - if (ARGV_WORD == c) { + if (ARGV_WORD == av) { *pos = la; break; } - if (ARGV_EOLN == c) + if (ARGV_EOLN == av) break; - if (ARGV_ARG == c) + if (ARGV_ARG == av) continue; mdoc_argv_free(arg); @@ -883,7 +883,7 @@ in_line(MACRO_PROT_ARGS) static int blk_full(MACRO_PROT_ARGS) { - int c, la; + int la; struct mdoc_arg *arg; struct mdoc_node *head; /* save of head macro */ struct mdoc_node *body; /* save of body macro */ @@ -892,6 +892,7 @@ blk_full(MACRO_PROT_ARGS) #endif enum mdoct ntok; enum margserr ac; + enum margverr av; char *p; /* Close out prior implicit scope. */ @@ -914,16 +915,16 @@ blk_full(MACRO_PROT_ARGS) for (arg = NULL;; ) { la = *pos; - c = mdoc_argv(m, line, tok, &arg, pos, buf); + av = mdoc_argv(m, line, tok, &arg, pos, buf); - if (ARGV_WORD == c) { + if (ARGV_WORD == av) { *pos = la; break; } - if (ARGV_EOLN == c) + if (ARGV_EOLN == av) break; - if (ARGV_ARG == c) + if (ARGV_ARG == av) continue; mdoc_argv_free(arg); @@ -963,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)) @@ -972,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)) @@ -1082,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) @@ -1185,8 +1186,6 @@ blk_part_exp(MACRO_PROT_ARGS) if (ARGS_EOLN == ac) break; - assert(ARGS_PHRASE != ac); - /* Flush out leading punctuation. */ if (NULL == head && ARGS_QWORD != ac && @@ -1269,8 +1268,9 @@ blk_part_exp(MACRO_PROT_ARGS) static int in_line_argn(MACRO_PROT_ARGS) { - int la, flushed, j, c, maxargs; + int la, flushed, j, maxargs; enum margserr ac; + enum margverr av; struct mdoc_arg *arg; char *p; enum mdoct ntok; @@ -1303,16 +1303,16 @@ in_line_argn(MACRO_PROT_ARGS) for (arg = NULL; ; ) { la = *pos; - c = mdoc_argv(m, line, tok, &arg, pos, buf); + av = mdoc_argv(m, line, tok, &arg, pos, buf); - if (ARGV_WORD == c) { + if (ARGV_WORD == av) { *pos = la; break; } - if (ARGV_EOLN == c) + if (ARGV_EOLN == av) break; - if (ARGV_ARG == c) + if (ARGV_ARG == av) continue; mdoc_argv_free(arg); @@ -1404,8 +1404,9 @@ in_line_argn(MACRO_PROT_ARGS) static int in_line_eoln(MACRO_PROT_ARGS) { - int c, la; + int la; enum margserr ac; + enum margverr av; struct mdoc_arg *arg; char *p; enum mdoct ntok; @@ -1416,15 +1417,15 @@ in_line_eoln(MACRO_PROT_ARGS) for (arg = NULL; ; ) { la = *pos; - c = mdoc_argv(m, line, tok, &arg, pos, buf); + av = mdoc_argv(m, line, tok, &arg, pos, buf); - if (ARGV_WORD == c) { + if (ARGV_WORD == av) { *pos = la; break; } - if (ARGV_EOLN == c) + if (ARGV_EOLN == av) break; - if (ARGV_ARG == c) + if (ARGV_ARG == av) continue; mdoc_argv_free(arg);