diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-30 21:28:30 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-30 21:28:30 +0000 |
commit | 5522c5dac7beb32c2ae73d2a8e943297cf725832 (patch) | |
tree | 2244b836f2ce742855767510b5bfd327d4c536c2 /mdoc_macro.c | |
parent | 1fb9bbde9209153b72e205e9961476641f5d87ce (diff) | |
download | mandoc-5522c5dac7beb32c2ae73d2a8e943297cf725832.tar.gz |
First in several iterative patches in getting complex -column lists
supported (which works but is tricky enough that it should be broken
down into digestable parts). This simply moves around the propogation
of ARGS_PEND into one recognised by phrase().
Added a few regressions for simple -column lists.
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r-- | mdoc_macro.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c index bb89b25a..daa6ae2a 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1002,6 +1002,7 @@ blk_full(MACRO_PROT_ARGS) } ac = ARGS_ERROR; + lac = ARGS_PHRASE; for ( ; ; ) { la = *pos; @@ -1013,16 +1014,10 @@ blk_full(MACRO_PROT_ARGS) if (ARGS_EOLN == ac) break; - if (ARGS_PEND == ac) { - if (ARGS_PPHRASE == lac) - ac = ARGS_PPHRASE; - else - ac = ARGS_PHRASE; - } - /* Don't emit leading punct. for phrases. */ if (NULL == head && + ARGS_PEND != ac && ARGS_PHRASE != ac && ARGS_PPHRASE != ac && ARGS_QWORD != ac && @@ -1035,6 +1030,7 @@ blk_full(MACRO_PROT_ARGS) /* Always re-open head for phrases. */ if (NULL == head || + ARGS_PEND == ac || ARGS_PHRASE == ac || ARGS_PPHRASE == ac) { if ( ! mdoc_head_alloc(m, line, ppos, tok)) @@ -1045,9 +1041,17 @@ blk_full(MACRO_PROT_ARGS) if (ARGS_PHRASE == ac || ARGS_PPHRASE == ac) { if (ARGS_PPHRASE == ac) m->flags |= MDOC_PPHRASE; - if ( ! phrase(m, line, la, buf, ac)) + if (ARGS_PEND == ac && ARGS_PPHRASE == lac) + m->flags |= MDOC_PPHRASE; + + if (ARGS_PEND == ac) { + if ( ! phrase(m, line, la, buf, lac)) + return(0); + } else if ( ! phrase(m, line, la, buf, ac)) return(0); + m->flags &= ~MDOC_PPHRASE; + if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos)) return(0); continue; |