diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-02-25 12:09:20 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-02-25 12:09:20 +0000 |
commit | 17758e0da9b52fb54e22c38cf77b36a01e52eb66 (patch) | |
tree | 5a2eb54f72021599f2ad8d629f0cc82c8ac55b92 /mdocterm.c | |
parent | aaa7fb04d08ab8d819cd5e3fa11c66b02fe536e8 (diff) | |
download | mandoc-17758e0da9b52fb54e22c38cf77b36a01e52eb66.tar.gz |
Added "termpair" for symmetric flag-setting.
Diffstat (limited to 'mdocterm.c')
-rw-r--r-- | mdocterm.c | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -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. */ |