summaryrefslogtreecommitdiffstats
path: root/mdocterm.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-02-25 12:09:20 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-02-25 12:09:20 +0000
commit17758e0da9b52fb54e22c38cf77b36a01e52eb66 (patch)
tree5a2eb54f72021599f2ad8d629f0cc82c8ac55b92 /mdocterm.c
parentaaa7fb04d08ab8d819cd5e3fa11c66b02fe536e8 (diff)
downloadmandoc-17758e0da9b52fb54e22c38cf77b36a01e52eb66.tar.gz
Added "termpair" for symmetric flag-setting.
Diffstat (limited to 'mdocterm.c')
-rw-r--r--mdocterm.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/mdocterm.c b/mdocterm.c
index d4b27c9e..014a010f 100644
--- a/mdocterm.c
+++ b/mdocterm.c
@@ -410,28 +410,46 @@ body(struct termp *p, const struct mdoc_meta *meta,
const struct mdoc_node *node)
{
int dochild;
+ struct termpair pair;
/* Pre-processing. */
dochild = 1;
+ pair.type = 0;
if (MDOC_TEXT != node->type) {
if (termacts[node->tok].pre)
- if ( ! (*termacts[node->tok].pre)(p, meta, node))
+ if ( ! (*termacts[node->tok].pre)(p, &pair, meta, node))
dochild = 0;
} else /* MDOC_TEXT == node->type */
word(p, node->data.text.string);
/* Children. */
+ switch (pair.type) {
+ case (TERMPAIR_FLAG):
+ p->flags |= pair.data.flag;
+ break;
+ default:
+ break;
+ }
+
if (dochild && node->child)
body(p, meta, node->child);
+ switch (pair.type) {
+ case (TERMPAIR_FLAG):
+ p->flags &= ~pair.data.flag;
+ break;
+ default:
+ break;
+ }
+
/* Post-processing. */
if (MDOC_TEXT != node->type)
if (termacts[node->tok].post)
- (*termacts[node->tok].post)(p, meta, node);
+ (*termacts[node->tok].post)(p, &pair, meta, node);
/* Siblings. */