From 14c096e3772b640b87176e27eaa291c9fefbe0de Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Fri, 7 May 2010 06:05:38 +0000 Subject: Initial ARGS_PPHRASE (partial phrase) framework. Running tally of changes in index.sgml. --- index.sgml | 11 ++++++++++- libmdoc.h | 3 ++- mdoc_argv.c | 4 +++- mdoc_macro.c | 11 ++++------- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/index.sgml b/index.sgml index 076a358d..d8415170 100644 --- a/index.sgml +++ b/index.sgml @@ -218,6 +218,16 @@ + + + + + -
xx-05-2010 + Clean-up in internal -mdoc library. Rolled back + break-at-hyphen (broken). -DUGLY is now the default + (why not). + Version: 1.9.24. +
07-04-2010 @@ -232,7 +242,6 @@ layout. Version: 1.9.23.
31-03-2010 diff --git a/libmdoc.h b/libmdoc.h index ede159f6..4b5ced27 100644 --- a/libmdoc.h +++ b/libmdoc.h @@ -117,7 +117,8 @@ enum margserr { ARGS_WORD, ARGS_PUNCT, ARGS_QWORD, - ARGS_PHRASE + ARGS_PHRASE, + ARGS_PPHRASE }; enum margverr { diff --git a/mdoc_argv.c b/mdoc_argv.c index 08de1bf0..0ab8d9d6 100644 --- a/mdoc_argv.c +++ b/mdoc_argv.c @@ -378,6 +378,7 @@ args(struct mdoc *m, int line, int *pos, { int i; char *p, *pp; + enum margserr rc; /* * Parse out the terms (like `val' in `.Xx -arg val' or simply @@ -440,6 +441,7 @@ args(struct mdoc *m, int line, int *pos, */ if (ARGS_TABSEP & fl) { + rc = ARGS_PHRASE; /* Scan ahead to tab (can't be escaped). */ p = strchr(*v, '\t'); @@ -488,7 +490,7 @@ args(struct mdoc *m, int line, int *pos, for (pp = &buf[*pos]; ' ' == *pp; pp++, (*pos)++) /* Skip ahead. */ ; - return(ARGS_PHRASE); + return(rc); } /* diff --git a/mdoc_macro.c b/mdoc_macro.c index eef40906..8bde22e5 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -632,7 +632,6 @@ append_delims(struct mdoc *mdoc, int line, int *pos, char *buf) 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) @@ -1187,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 && -- cgit