summaryrefslogtreecommitdiffstats
path: root/mdoc_macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-15 04:47:38 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-15 04:47:38 +0000
commit9910c76a0f15d7eed9a557972be5115b17ceacc2 (patch)
tree09a25748c49e5fda9b4cb748ca6dbb668f699367 /mdoc_macro.c
parent5fa55a22ad502f15707541af5206ee738f97227c (diff)
downloadmandoc-9910c76a0f15d7eed9a557972be5115b17ceacc2.tar.gz
More `Bl -column' dancing: It children also inherit in-phrase flags (noted by Ingo Schwarze).
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r--mdoc_macro.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c
index caf7637c..8886a6b6 100644
--- a/mdoc_macro.c
+++ b/mdoc_macro.c
@@ -972,12 +972,18 @@ 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_PHRASE != ac &&
ARGS_PPHRASE != ac &&
- ARGS_PEND != ac &&
ARGS_QWORD != ac &&
1 == mdoc_isdelim(p)) {
if ( ! mdoc_word_alloc(m, line, la, p))
@@ -989,29 +995,18 @@ blk_full(MACRO_PROT_ARGS)
if (NULL == head ||
ARGS_PHRASE == ac ||
- ARGS_PEND == ac ||
ARGS_PPHRASE == ac) {
if ( ! mdoc_head_alloc(m, line, ppos, tok))
return(0);
head = m->last;
}
- if (ARGS_PHRASE == ac ||
- ARGS_PEND == ac ||
- ARGS_PPHRASE == ac) {
- /*
- * Special treatment for the last phrase. A
- * prior ARGS_PHRASE gets is handled as a
- * regular ARGS_PHRASE, but a prior ARGS_PPHRASE
- * has special handling.
- */
- if (ARGS_PEND == ac && ARGS_ERROR == lac)
- ac = ARGS_PHRASE;
- else if (ARGS_PEND == ac && ARGS_PHRASE == lac)
- ac = ARGS_PHRASE;
-
+ if (ARGS_PHRASE == ac || ARGS_PPHRASE == ac) {
+ if (ARGS_PPHRASE == ac)
+ m->flags |= MDOC_PPHRASE;
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;
@@ -1569,22 +1564,19 @@ phrase(struct mdoc *m, int line, int ppos, char *buf, enum margserr ac)
enum mdoct ntok;
char *p;
- assert(ARGS_PHRASE == ac ||
- ARGS_PEND == ac ||
- ARGS_PPHRASE == ac);
+ assert(ARGS_PHRASE == ac || ARGS_PPHRASE == ac);
for (pos = ppos; ; ) {
la = pos;
- aac = mdoc_zargs(m, line, &pos, buf, ARGS_PPHRASED, &p);
+ aac = mdoc_zargs(m, line, &pos, buf, 0, &p);
if (ARGS_ERROR == aac)
return(0);
if (ARGS_EOLN == aac)
break;
- ntok = ARGS_QWORD == aac || ARGS_PEND == ac ?
- MDOC_MAX : lookup_raw(p);
+ ntok = ARGS_QWORD == aac ? MDOC_MAX : lookup_raw(p);
if (MDOC_MAX == ntok) {
if ( ! mdoc_word_alloc(m, line, la, p))