version 1.8, 2009/02/24 14:52:55 |
version 1.11, 2009/02/25 13:30:53 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se> |
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se> |
* |
* |
Line 200 flushln(struct termp *p) |
|
Line 200 flushln(struct termp *p) |
|
*/ |
*/ |
|
|
if (p->flags & TERMP_NOBREAK) { |
if (p->flags & TERMP_NOBREAK) { |
for ( ; vis <= maxvis; vis++) |
for ( ; vis < maxvis; vis++) |
putchar(' '); |
putchar(' '); |
} else |
} else |
putchar('\n'); |
putchar('\n'); |
Line 221 newln(struct termp *p) |
|
Line 221 newln(struct termp *p) |
|
if (0 == p->col) |
if (0 == p->col) |
return; |
return; |
flushln(p); |
flushln(p); |
|
p->flags &= ~TERMP_NOLPAD; |
} |
} |
|
|
|
|
Line 410 body(struct termp *p, const struct mdoc_meta *meta, |
|
Line 411 body(struct termp *p, const struct mdoc_meta *meta, |
|
const struct mdoc_node *node) |
const struct mdoc_node *node) |
{ |
{ |
int dochild; |
int dochild; |
|
struct termpair pair; |
|
|
/* Pre-processing. */ |
/* Pre-processing. */ |
|
|
dochild = 1; |
dochild = 1; |
|
pair.type = 0; |
|
pair.offset = pair.rmargin = 0; |
|
pair.flag = 0; |
|
|
if (MDOC_TEXT != node->type) { |
if (MDOC_TEXT != node->type) { |
if (termacts[node->tok].pre) |
if (termacts[node->tok].pre) |
if ( ! (*termacts[node->tok].pre)(p, meta, node)) |
if ( ! (*termacts[node->tok].pre)(p, &pair, meta, node)) |
dochild = 0; |
dochild = 0; |
} else /* MDOC_TEXT == node->type */ |
} else /* MDOC_TEXT == node->type */ |
word(p, node->data.text.string); |
word(p, node->data.text.string); |
|
|
/* Children. */ |
/* Children. */ |
|
|
|
if (TERMPAIR_FLAG & pair.type) |
|
p->flags |= pair.flag; |
|
|
if (dochild && node->child) |
if (dochild && node->child) |
body(p, meta, node->child); |
body(p, meta, node->child); |
|
|
|
if (TERMPAIR_FLAG & pair.type) |
|
p->flags &= ~pair.flag; |
|
|
/* Post-processing. */ |
/* Post-processing. */ |
|
|
if (MDOC_TEXT != node->type) |
if (MDOC_TEXT != node->type) |
if (termacts[node->tok].post) |
if (termacts[node->tok].post) |
(*termacts[node->tok].post)(p, meta, node); |
(*termacts[node->tok].post)(p, &pair, meta, node); |
|
|
/* Siblings. */ |
/* Siblings. */ |
|
|